Created
November 2, 2012 08:37
-
-
Save StevenMcD/3999511 to your computer and use it in GitHub Desktop.
Powershell script with git helpers for work
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
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