alias gp="git push" has probably saved me hours of my life
My bashrc has so many of these, and they're probably among the most common commands I use daily!:
alias gs="git status"
alias gb="git branch"
alias grh="git reset --hard"
alias gcdf="git clean -df"
alias gf="git fetch"
alias gp="git pull"
alias gdom="git diff origin/master"
alias gdomn="git diff --name-status origin/master"
alias gd="git diff"
alias gl="git log"
alias glm="git log --author <my_name>"
alias gc="git checkout"
alias gcm="git checkout master"My team doesn't have a strict commit message style guide, but good god it better be at least mildly descriptive of what's in the commit.
(I know you're joking, the thought of a 3 character alias to commit with a dummy message just sent shivers down my spine :)
$ cat << EOF > ~/.commit_reasons; strfile ~/.commit_reasons
Testing...
%
Testify...
%
Testarossa...
%
Does it work yet?
%
How bout now?
%
Oops.
%
Fixed a thing.
%
EOF
$ fortune ~/.commit_reasons | cowsay | git -F -I only use a few git aliases, most things I'd rather type out.
It's just so much quicker to recall stuff: [g]it [s]tatus :)
From my .gitconfig:
[alias]
st = status
ci = "!git add -u && git commit"
di = diff
I come from an SVN background, I've since switched to Mercurial for my personal projects, and intensely dislike git, but have to use git at work, so I finally said "enough is enough" and made aliases so I can use git like svn/hg.alias goto='git checkout'
alias b='/usr/local/bin/git checkout -b'
alias a='/usr/local/bin/git add
alias d='/usr/local/bin/git diff HEAD'
alias c='git commit -m'
alias i='/usr/local/bin/git pull origin'
alias o='/usr/local/bin/git branch -avv | grep "\*" | cut -d\ -f 2 | xargs -n 1 /usr/local/bin/git push -u origin'
plus: alias g='/usr/local/bin/git log --graph --oneline --decorate
alias v='/usr/local/bin/git branch -avv'--all'
alias h='/usr/local/bin/git log -p'
can be useful.