recent posts

How to synchronize your branch on bitbucket

There are times when I am unable to "Sync now" on bitbucket when it is several commits behind, and bitbucket will prompt me to resolve some conflicts from the command line. Here are the steps I take to move my "master" branch forward so it is not out of sync with my main "develop" branch.

Command Line (Will need write permissions)

Bitbucket will provide the commit hash for DETACHED HEAD. You can also find the latest commit hash using git log.
  • git checkout master
  • git reset --soft <latest commit hash in your `git log`>
  • git merge --squash --strategy-option theirs remotes/origin/develop
  • git commit -m "Move master forward to be in sync with develop"
  • git push -u --force origin master

Bitbucket Branch Web UI

  • Navigate to the "master" branch in your repository
  • Click on "Sync now"
  • You should see a commit message of "Merged develop into master" and you should be all set!


How to synchronize your branch on bitbucket How to synchronize your branch on bitbucket Reviewed by JJ The Engineer on 1:07 PM Rating: 5

3 comments:

Powered by Blogger.