Skip to content

Instantly share code, notes, and snippets.

@csarron
Last active July 12, 2018 19:01
Show Gist options
  • Save csarron/c84ee58e2bf933e6e9d2a3c01fbd5d57 to your computer and use it in GitHub Desktop.
Save csarron/c84ee58e2bf933e6e9d2a3c01fbd5d57 to your computer and use it in GitHub Desktop.
handy git alias for powershell
# 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