Posts Tagged ‘git’

First you need to add a remote branch to your repository that points to the original repo you forked from.

git remote add --track [branch to track] [name to call it][user]/[repo].git

You will want to replace ‘[branch to track]’ with the branch you want to track in the remote repo. In most cases this will be ‘development’, although you could replace it with edge or any other branch. You should also replace ‘name to call it’ is what you the remote will be called.

To verify the remote repository was added run

git remote

You should see the new remote repo, in this case named ‘[name to call it]’, along with any other remote repositories you may have previously added.

Now we can fetch all the changes from the fork’s code base.

git fetch [name to call it]

This will create a new remote branch called ‘[name to call it]/[branch to track]’. Now we are ready to merge the code from the remote repository.

git merge [name to call it]/[branch to track]