135 questions
3 votes
3 answers
183 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:-.}; \ ...
1 vote
1 answer
1k views
How can I add a custom commit message to this git alias?
git config --global alias.a '!git commit -a -m "commit" && git push' Not sure how to use the !sh
2 votes
1 answer
422 views
How do I make git alias for 'git gc' work [duplicate]
For some reason I have to run git gc --prune=now almost every day before I run a git pull so I wanted to create a git pp alias that helps me run those two commands I added this to the users .gitconfig ...
1 vote
1 answer
1k views
How to alias "git push" into itself + running a script?
I need to run a script which notifies my CI server after I push. Therefore I need to alias "git push" into "git push; powershell script.ps1". Here is what I am trying: $ alias git ...
0 votes
1 answer
143 views
Alias error: using cd command with Git bash
I am trying to add an alias to git to redirect to the project folder, open VS Code and run a local server my alias: [alias] creative = cd e:/work/vero/creative-app/front-end && code . &...
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 &...
865 votes
26 answers
432k views
How do I alias commands in git?
I saw a screencast where someone had gotten git st git ci to work. When I do it I get an error asking me if I meant something else. Being a git newb, I need to know what you have to do to get this ...
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; ...
4 votes
8 answers
3k views
Create a git command to open repository in browser
I want to create a git alias which will allow me to do git visit and the repository will be opened in the browser.