gs git status
gp git push
gac git commit -am
gc git commit
gcm git commit -m
gA git add -A
gC git checkout
ga git add
gd git diff
gm git merge
gmc git merge --continue
gpu git pull
grc git rebase --continue
The only problem is that I cannot use git on anybody else's machine, the muscle memory is too strongly ingrained now. This is a common message: The program 'gs' is currently not installed. You can install it by typing:
sudo apt install ghostscript $ -gsBut anyway, if someone asks for help with "how to fix my mess in git", the absolutely first thing I do is exactly `git log --graph --decorate --all --oneline`, to start finding out visually what the mess actually is.
Of course, my personal solution instead of aliases was to switch to using SourceTree.
A few more I live and die by:
gf git fetch --all; git fetch --tags
gh git log --oneline --abbrev-commit --all --graph --decorateedit: yep, per git help log:
--oneline
This is a shorthand for "--pretty=oneline --abbrev-commit"
used together. gdc git diff --cached
gg git grep -n
gss git status -s
glo git log --oneline
gamend git commit --amend --no-editPersonally, I use mostly command line git and on occasion a little bit of gitk if I get lost between all the branches. I die a little (read: a lot) inside when I have to help my team members with git and they adamantly stick to TortoiseGit. It's a prime example of the UI improving discoverability at the expense of performance (and even then the individual actions tend to get lost between all the numerous possible actions).
It is similar for committing, where checking diffs and partial adding is part of the process.
Using an IDE or GUI might help to streamline this. I do not use any, so I don't know if they do this.
Maybe I should analyse my shell history for sequences?
alias ga='git add'
alias gb='git branch'
alias gbD='gb -D '
alias gbc='gc -b '
alias gbd='gb -d '
alias gc='git checkout'
alias gcm='git checkout master'
alias gd='git diff '
alias gdd='gd --cached'
alias gdm='gd master...'
alias ge='git grep -InE '
alias gec='git branch --remotes --contains '
alias geh='git log --all --oneline --decorate -G '
alias gei='ge -i'
alias gff='gh && gpr && gr && ghp'
alias gfm='b=$(gw) && [[ "$b" != master ]] && gcm && gpr && gfu && gr && gc $b && unset b'
alias gfr='git fetch && git rebase origin/master'
alias gfu='git fetch upstream && git merge upstream/$(gw)'
alias gh='git stash'
alias gha='gh -k'
alias ghp='gh pop'
alias ghs='gh show -p '
alias gl='git log --graph --decorate --all'
alias gll='gl --pretty=format:"%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s" --relative-date'
alias glll='gl --color --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset'\'' --abbrev-commit'
alias gp='git pull '
alias gpr='git pull origin $(gw)'
alias gps='git push'
alias gpt='gps --tags'
alias gr='git push origin $(gw)'
alias grr='git rebase -i HEAD~$(grrr | wc -l)'
alias grrr='git rev-list master..'
alias grt='gr --tags'
alias gs='git status'
alias gss='git show'
alias gu='git config --get remote.origin.url'
alias gv='git describe --abbrev --dirty --always --tags'
alias gw='git rev-parse --abbrev-ref HEAD 2>/dev/null'
alias gx='git archive --format tar --remote 'https://mikegerwitz.com/projects/git-shortmaps/about/
It creates the aliases as you do, but also includes tab completion, and only takes effect when you're in a repository path.
Alas, that is not the case with bash.
I also have the aliases g for git, m for make, and v for vim.