Created
May 1, 2013 20:54
-
-
Save gilesbowkett/5498308 to your computer and use it in GitHub Desktop.
github help article implemented as shell script. is there an easier way?
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
# based on the workflow from https://help.github.com/articles/syncing-a-fork | |
function fetch_remotes() { | |
for remote in $(echo $(git remote)) | |
do | |
git fetch $remote | |
done | |
} | |
function hub_sync() { | |
git co master && | |
fetch_remotes && | |
git merge upstream/master && | |
git push origin master && | |
git st | |
} | |
hub_sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would also recommend using either
git rebase upstream/master
instead ofgit merge
or adding the--ff-only
flag to themerge
command. This way your fork's history closely matches theupstream
. Otherwise your fork could begin to accumulate merge-commits.