Rename remote branch

后端 未结 2 1311
南旧
南旧 2021-02-20 07:52

I have created a local branch X that at some point I pushed to remote server (origin)

git push origin X

I realized it\'s a bad idea to have bra

相关标签:
2条回答
  • 2021-02-20 08:42

    other people will keep a pointer to branch X (as origin/X) in their repository until they run git remote prune origin. it's left as a stale branch

    when fetching/pulling they will get a second point to (newly created) branch Y (as origin/Y)

    branching and merging is not affected by this.

    so, as long as all commits are still reachable from your branch, renaming is fine.

    0 讨论(0)
  • 2021-02-20 08:46

    If others have pulled the branch to their local repositories it is not safe to delete it. One route to consider is deleting all the files from the old branch. Leave a README pointing to the new branch.

    0 讨论(0)
提交回复
热议问题