Skip to content

Instantly share code, notes, and snippets.

@StevenMcD
Created November 2, 2012 08:37
Show Gist options
  • Save StevenMcD/3999511 to your computer and use it in GitHub Desktop.
Save StevenMcD/3999511 to your computer and use it in GitHub Desktop.
Powershell script with git helpers for work
Function pull {
git fetch origin
$part1 = git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
$part2 = git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 4
if($part2 -ne ""){
$branchName = $part1 + "/" + $part2
} else {
$branchName = $part1
}
git pull --rebase origin $branchName
}
Function fetchAll {
git fetch origin
git checkout <branchName>
git reset --hard
git pull --rebase origin <branchName>
git checkout <branchName2>
git reset --hard
git pull --rebase origin <branchName2>
}
Function reset {
git reset --hard
}
Function ci {
git add .
git commit -v
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment