[英]Can we commit on branch that's already been merged with master?
I have a branch, say " XYZ ", I worked and did a few commits on that branch and later merged it with my master branch.我有一个分支,比如说“ XYZ ”,我在那个分支上工作并做了一些提交,然后将它与我的主分支合并。 Now, I want to do some more changes in my code and want to use that same branch.现在,我想对我的代码进行更多更改并希望使用相同的分支。 I have not deleted the branch.我没有删除分支。
Can I use the same branch again?我可以再次使用同一个分支吗? Can I then merge the new commits with master again?然后我可以再次将新提交与 master 合并吗? Or is the only solution to create another branch?或者是创建另一个分支的唯一解决方案?
You can still work on that branch as it still exists.您仍然可以在该分支上工作,因为它仍然存在。
The git-merge documentation says: git-merge文档说:
Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch.将来自命名提交的更改(从它们的历史从当前分支开始)合并到当前分支中。
You can continue working on your branch and then when you merge with master again, it will bring the commits that are missing on master.您可以继续在您的分支上工作,然后当您再次与 master 合并时,它将带来 master 上缺少的提交。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.