Here are the Git aliases I use…
[alias]
roh = "!git reset origin/$(git branch-name) --hard"
ro = "!git rebase origin/$(git branch-name)"
branch-name = "!git rev-parse --abbrev-ref HEAD"
new-commits = "!git log origin/$(git branch-name).."
old-commits = "!git log ..origin/$(git branch-name)"
cp = cherry-pick
rc = rebase --continue
k-new-commits = "!gitk origin/$(git branch-name).. &"
romi = rebase origin/master -i
rom = rebase origin/master
check = !"sh $HOME/git-check.sh"
[core]
editor = \"C:\\\\Program Files (x86)\\\\Notepad++\\\\notepad++.exe\" -multiInst -notabbar -nosession -noPlugin
[push]
default = current
Aliases explained
roh
- Reset origin hard reset the current branch to the head of its remote branchro
- Rebase origin rebase current branch over the remote branchnew-commits
- log new commits report the commits on the local branch and not the remote branchold-commits
- log old commits remote the commits on the remote branch and not the local branchcp
- cherry pick needs no introduction!k-new-commits
- visually log new commits report the commits on the local branch and not the remote branch with gitkromi
- interactive rebase over origin/master rebase current branch over origin/master interactivelyrom
- rebase over origin/master rebase current branch over origin/mastercheck
- interactive stage changes interactively stage changed and new files
Internal-alias functions
branch-name
- Get the name of current branch