Created
October 12, 2011 04:35
-
-
Save jmarnold/1280290 to your computer and use it in GitHub Desktop.
The Good Morning Command
This file contains 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
# the good-morning command (where upstream is your target remote -- or could be origin) | |
function gm { | |
branch_name="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')" | |
echo "Currently on $branch_name" | |
git checkout master | |
git pull upstream master | |
git checkout $branch_name | |
git rebase master | |
} |
with msysgit installed
- vim ~/.bashrc
- :set paste (notice the prefixing colon)
- press 'i' to go into insert mode
- paste function above
- press esc
- :wq (notice the prefixing colon)
- source ~/.bashrc
- inside git bash just type 'gm'
Got it, thanks!
Look, people like my stuff
…On Tue, Dec 6, 2011 at 5:08 PM, Chris Patterson < ***@***.*** > wrote:
Got it, thanks!
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1280290
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call me a moron, but how do I use this on Windows? :)