135 questions
3 votes
3 answers
182 views
git config alias function : Bad substitution
I have the following git alias function that moves files into a directory using git mv of those files and then does the git commit : [alias] mv-into-dir = "!mvIntoDIR() { \ cd ${GIT_PREFIX:-.}; \ ...
0 votes
1 answer
117 views
git commit message as variable in linux [duplicate]
I am trying in my linux (Xubuntu) console to make the git commit message in my chain of commands a variable so I can more easily execute my chain of commands. Instead of this where I habe to edit ...
3 votes
1 answer
189 views
Inconsistency in the way aliases are parsed in .gitconfig
I got an error two hours ago from this alias in the .gitconfig file, which is: [alias] chist = log --graph -10 --pretty=format:"%C(cyan)%h%Creset %<(20,trunc)%s %Cgreen%<(11,trunc)%an%...
0 votes
0 answers
49 views
Cannot create git alias in zsh (expansion failed; git not a git command)
Environment/Background: zsh (v5.9) git (v2.48) git --exec-path results in /usr/lib/git-core Other StackOverflow posts read: Can't add git alias when using shell function Creating alias in git ...
1 vote
1 answer
128 views
Git alias to rebase onto commit before message
Here's a common workflow: Make some changes and commit, e.g. git commit -m 'add action buttons' Make a bunch of interim commits Realize I want to fix that first commit Search for the commit SHA in ...
0 votes
0 answers
30 views
Forward some arguments in git alias but not all
If I write git config --global alias.foo '!git bar "$@", all arguments provided to git foo will be forwarded to git bar while preserving spaces within arguments. For example, git foo hi &...
0 votes
1 answer
69 views
Git alias to add files and then show status is showing from parent directory
I work in C# with Unity, and it often touches a lot of files that don't want to commit. My changes that I want to commit are almost always exclusively .cs files. I created a git alias to stage all of ...
1 vote
0 answers
46 views
How to make git autocomplete branch names for aliases
I have a couple of git alias in my ~/.gitconfig file, like so: [alias] co = checkout dd = diff --relative --name-status While in Bash, when I type git co <tab> I get a list of branches to ...
1 vote
1 answer
215 views
git: determine if repo was cloned blobless or treeless
I want a programmatic way (preferably an alias) to determine whether a repository was cloned with either --filter=blob:none or --filter=tree:0, and to be able to tell which. eg: if git is-treeless; ...
0 votes
0 answers
77 views
Git Alias - Create multiple merge request from one source branch to multiple target branches
I'm trying to create a git alias to create three merge request (master, release, develop) from the current working branch. Somehow it doesn't recognize the -o merge_request.target=* on the seconde and ...
1 vote
1 answer
55 views
Unable to register git `log` alias using CMD
I am trying to alias a log command using Windows CMD (using " because of Windows, see this answer): git log --pretty=format:"%C(yellow)%h %C(red)%ad %C(brightcyan)%d %C(white)%s" --date=...
1 vote
1 answer
70 views
Trouble with Custom Git Aliases on Windows
I have these 2 aliases: ctt = "!f() { $(git rev-parse --abbrev-ref HEAD) -ne 'develop' && git tag -a testing-$(git rev-parse --abbrev-ref HEAD)-$(date +'%Y%m%d')-$1 -m '$2' && git ...
1 vote
1 answer
73 views
git alias arguments with default, without blocking the rest of the line
Here's my alias for interactively rebasing, by default onto the point where my branch diverged from develop. git config --global alias.ri '!git rebase -i ${1-$(git merge-base HEAD origin/develop)} #' ...
1 vote
0 answers
70 views
Why does git ls-files ignore the working directory when used in a git alias?
I have a git repository with a few files and subdirectories. If I have a terminal window open in one of these subdirectories and execute git ls-files, I get a list of the files within my current ...
1 vote
0 answers
53 views
Using Git aliasing for changing directory in Windows CMD [duplicate]
This is arguably a convoluted question, but is there a way to create a Git command to change directory using aliasing, but to be used in the Windows command prompt? The goal is to leverage Git's ...