How to get aliases working in .gitconfig?

Github has the following recommendation for a global git configuration ~/.gitconfig:

[alias]             # Is this [-] only a comment in .gitconfig?
gb = git branch
gba = git branch -a
gc = git commit -v
gd = git diff | mate  
gl = git pull
gp = git push
gst = git status

The above commands worked in my old Git. However, they are not working now for some unknown reason.

The problem does not seem to be in the teams. Perhaps in another related git file that controls which file affects aliases.

How can you make aliases work?

+5
source share
2 answers

I believe that GitHub refers to system aliases, not .gitconfig aliases.

, , , Unix, :

alias g=’git’
alias gb=’git branch’
alias gba=’git branch -a’
alias gc=’git commit -v’
alias gca=’git commit -v -a’
alias gd=’git diff | mate’
alias gl=’git pull’
alias gp=’git push’
+6

, , , git git, st = status:

$ git st

:

$ gst

git status bash ( , ).

, , git (, st status), git. , , git, , git-config(1). ~/.gitconfig :

[alias]
    st = status
    ci = commit -s
    br = branch
    co = checkout
    vis = !gitk --all &

:

$ git st # Runs "git status"
$ git ci # Runs "git commit -s"
$ git vis # runs "gitk --all &"

.

+12

All Articles