Updating a GitHub Fork

If you want to contribute a new feature to an open-source project hosted on GitHub, you can fork the repository, make your changes, test them, commit them, and finally open a pull request.

Over time, your local repository might become outdated. How can you update your fork with the latest version from the main repository?

  1. Add a new upstream remote to track the main repository:

    1
    
     $ git remote add upstream git://github.com/octocat/Spoon-Knife.git
    
  2. Fetch updates from the upstream repository:

    1
    
     $ git fetch upstream
    
  3. Merge upstream/master into your current branch to apply the updates:

    1
    
     $ git merge upstream/master
    

Resources:

Next: Migrate Heroku Shared Database (Postgres) to Amazon RDS (MySQL)