Keeping your bitbucket repo in sync with upstream

I imported the NuttX repository to my bitbucket account with name nuttx_nyx (for NyX board). Then I want to keep it in sync with mainline/upstream without accessing the bitbucket page to click on “Sync” button.

So you just need to add the upstream remote:

$ git remote add upstream

Then we have two remotes now:

$ git remote -v

origin (fetch)
origin (push)

upstream (fetch)
upstream (push)

Then when you fetch from upstream it will be putted on you origin/master:

$ git fetch upstream
   afe137f..fe7d8c9  master     -> origin/master

Fine, now just do the default way:

$ git push origin master

You can create your local commit and rebase it with be on top of upstream and saved to your repository.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s