Created
April 18, 2016 08:23
-
-
Save remigijusj/6e1f66ef6c3ca078c571d22fb7d7e107 to your computer and use it in GitHub Desktop.
My GIT aliases
This file contains 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] | |
s = !git status | |
k = !gitk | |
br = !git branch | |
co = "!f() { git checkout `git locax $1`; }; f" | |
ff = !git reset --hard origin/`git this` | |
ffm = !git push . origin/master:master | |
new = !git checkout -b | |
brd = "!f() { git branch -D `git loca $1`; }; f" | |
grab = !git fetch origin -p | |
home = !git checkout master | |
this = !git symbolic-ref --short HEAD | |
jump = "!f() { git stash save && git ff && git stash pop; }; f" | |
fork = "!f() { branch=$(git remo $1); git checkout --track -b $branch origin/$branch; }; f" | |
loca = "!f() { git branch -l | grep \"$1\" | head -n 1 | cut -b 3-; }; f" | |
remo = "!f() { git branch -r | tail -n +2 | grep \"$1\" | head -n 1 | cut -b 10-; }; f" | |
locax = "!f() { branch=$(git loca $1); if [ -z $branch ]; then echo \"$1\"; else echo \"$branch\"; fi; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment