Last active
July 12, 2018 19:01
-
-
Save csarron/c84ee58e2bf933e6e9d2a3c01fbd5d57 to your computer and use it in GitHub Desktop.
handy git alias for powershell
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
# code $profile.CurrentUserAllHosts | |
Import-Module posh-git | |
function ga { | |
git add $args | |
} | |
function gaa { | |
git add --all | |
} | |
function gb { | |
git branch | |
} | |
function gcb { | |
git checkout -b | |
} | |
function gcm { | |
git checkout master | |
} | |
function gcmsg { | |
git commit -m $args | |
} | |
function gco { | |
git checkout $args | |
} | |
function gd { | |
git diff $args | |
} | |
function gdca { | |
git diff --cached | |
} | |
function gf { | |
git fetch $args | |
} | |
function gfa { | |
git fetch --all --prune | |
} | |
function gfo { | |
git fetch origin | |
} | |
function ggpull { | |
$branch= &git rev-parse --abbrev-ref HEAD | |
git pull origin $branch | |
} | |
function ggpush { | |
$branch= &git rev-parse --abbrev-ref HEAD | |
git push origin $branch | |
} | |
function gm { | |
git merge $args | |
} | |
function gmom { | |
git merge origin/master | |
} | |
function gp { | |
git push $args | |
} | |
function grh { | |
git reset HEAD | |
} | |
function grhh { | |
git reset HEAD --hard | |
} | |
function grv { | |
git remote -v | |
} | |
function gss { | |
git status -s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment