gpt4 book ai didi

git - pull 请求成功后在 Git 中更改分支和删除分支

转载 作者:太空狗 更新时间:2023-10-29 13:56:27 26 4
gpt4 key购买 nike

我从master创建了一个分支"newbranch",然后推回原点。然后我创建了一个 pull request,它被接受并 merge 到 master 中。

此时我应该从我的本地删除 "newbranch" 并从 master 重新 pull 以开始处理新的东西吗?

在一个分支被接受掌握后,正确的流程是什么?

最佳答案

2013 年 4 月更新:

参见“Redesigned merge button”和“What do you do with your branch after a pull request on GitHub?”:

分支现已为您删除

new merge button


原始答案(2013 年 2 月)

博文“Tidying up after Pull Requests”更加明确:

The only trouble is that we end up with a lot of defunct branches after Pull Requests have been merged or closed.
From time to time, one of us would clear out these branches with a script, but we thought it would be better to take care of this step as part of our regular workflow on GitHub.com.

Starting today, after a Pull Request has been merged, you’ll see a button to delete the lingering branch:

enter image description here

唯一不想删除该分支的情况是:

  • 如果您打算在当前补丁上进行扩展,请重复使用相同的分支
  • 或者您已经开始了一些尚未 merge/接受的提交,如果您删除了分支,这些提交将会丢失:

If the Pull Request was closed without being merged, the button will look a little different to warn you about deleting unmerged commits:

enter image description here

这样可以避免任何意外,过早删除分支。

关于git - pull 请求成功后在 Git 中更改分支和删除分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14903516/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com