删除远程分支是否有任何真正的区别
git branch -Dr origin/<branch name>与删除
.git/refs/remotes/origin/<branch name>直?
据我所知,没有,但是最好使用预期的git CLI进行任何git操作。
Is there any real difference between deleting a remote branch with
git branch -Dr origin/<branch name>vs. deleting
.git/refs/remotes/origin/<branch name>directly?
As far as I can tell, there isn't, but it's preferred to do any git operations with the intended git CLI.
最满意答案
是:
如果已将分支添加到.git/packed-refs ,则删除已解压缩的ref文件(如果存在 - 如果远程跟踪分支自所述打包以来已更新)将仅恢复打包的ref,但删除分支使用前端命令将删除这两个副本。
此外,前端命令删除分支的reflog(如果存在所述reflog)。 这既好(防止以后出现问题)又坏(如果你改变主意,你就无法获得reflog)。
Yes:
If the branch has been added to .git/packed-refs, deleting the unpacked ref file (if it exists—it will if the remote-tracking branch has been updated since said packing) will simply restore the packed ref, but deleting the branch with the front end command will delete both copies.
Also, the front end command deletes the reflog for the branch (if said reflog exists). This is both good (prevents problems later) and bad (you can't get the reflog back if you change your mind).
更多推荐
发布评论