2013年1月10日 星期四

How replace old 'master' branch with new 'master' branch

Sometime, the master's commits was arranged with 'rebase' and the master branch has new commits.
How to update commits of new master branch to remote repository's master branch

  $ git push --force origin master

If the arranged branch isn't 'master', need to rename 'master' to other name, like 'old_master',
than rename arranged branch to 'master', and push with --force parameter.

  $ git branch -m master old_master
  $ git branch -m new_master master
  $ git push --force origin master

沒有留言: