Rename remote branch

后端 未结 2 1273
南旧
南旧 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.

提交回复
热议问题