Last active
December 12, 2017 18:11
-
-
Save realshadow/c0b7aa19f2210a051e8a to your computer and use it in GitHub Desktop.
Git aliases - for mercurial users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# -- git ff {source} into {destination}; e.g. git ff dev test | |
ff = !sh -c 'git checkout $2 && git merge "$1" && git checkout "$1"' - | |
su = submodule update --init --recursive | |
co = checkout | |
ci = commit | |
st = status | |
graph = !sh -c 'git log --graph --decorate --oneline -n "$1"' - | |
# -- moves all changes to a newly created branch (which means it can not exist locally) | |
rb = !sh -c 'git checkout -b $1' - | |
# -- git sync {branch that will be merged to all env branches}; e.g. git sync dev | |
sync = !sh -c 'git ff "$1" test && git ff "$1" stage && git ff "$1" prod' - | |
# -- pull with update | |
pm = !sh -c 'git stash && git pull && git stash pop' - | |
# -- remove submodule | |
rms = "!f(){ git rm --cached \"$1\";rm -r \"$1\";git config -f .gitmodules --remove-section \"submodule.$1\";git config -f .git/config --remove-section \"submodule.$1\";git add .gitmodules; }; f" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment