Git is a great tool.
When using it from the command line (which I would recommend to everyone) there can be a lot to remember.
As with everything, I like to customise how I work and Git is no exception.
Adding a git alias is a simple process.
From your terminal/Powershell type:
git config --global alias.{alias} {git command}
Below are the aliases I use on a daily basis which really speed up my workflow:
git config --global alias.s status
git config --global alias.l log
git config --global alias.lo log --oneline
git config --global alias.cm commit -m
git config --global alias.cd checkout development
git config --global alias.co checkout
git config --global alias.ap add -p
git config --global alias.rhh reset HEAD --hard
git config --global alias.rcb rebase -i
git config --global alias.rlt rebase -i HEAD~10
git config --global alias.pick cherry-pick
git config --global alias.ka gitk --all
If you are having trouble with Folder Redirection in Windows, you can copy these aliases into the local config of the git project: ./{gitProject}/.git/config
, under the [alias]
section:
[alias]
s = status
l = log
lo = log --oneline
cm = commit -m
cd = checkout development
co = checkout
ap = add -p
rhh = reset HEAD --hard
rcb = rebase -i
rlt = rebase -i HEAD~10
pick = cherry-pick
ka = gitk --all