Simple workflow to keep forked Git repos up to date
When you're contributing to projects on Github you often want to pull updates from the original repo, then push changes to a forked repo on your own Github account. Code, lather, repeat. A shell extension called Hub makes this easy.
This is a quick reminder of the workflow once you've gotten used to what Hub does behind the scenes.
OK, on to the notes. These assume that you've aliased 'hub' to 'git', as the docs recommend.
- Clone a remote project on gitgub
git clone githubuser/projectname
cd project_name</code></pre>
Create forked repo on your github account. fork also adds a new git remote named your_github_username
git fork</code></pre>
Create a branch, do some work.
Push your feature branch to your github repo
git push -u yourgithubaccount yourfeaturebranch</code></pre>
In the future you can git pull origin (probably with the --rebase flag) to get updates from the original project, and git some_command your_github_account to interact with your forked version. Short, simple, and consistant. Sweet!
Written by Rob Wierzbowski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Github
Authors
jjperezaguinaga
90.17K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#