Skip to content

Instantly share code, notes, and snippets.

@drlongnecker
Created July 25, 2012 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drlongnecker/3176891 to your computer and use it in GitHub Desktop.
Save drlongnecker/3176891 to your computer and use it in GitHub Desktop.
Lazy Git Merge
# for when you're just too lazy to type out the merge command
# and change branches
function merge([string] $target, [string] $source) {
if ($source -eq "") {
$symbolicref = git symbolic-ref HEAD
$source = $symbolicref.substring($symbolicref.LastIndexOf("/") +1)
}
write-host "Merging $source into $target" -for white -ba red
git checkout $target; git merge $source; git checkout $source
write-host "Done!" -for black -ba green
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment