[英]Git - Commits out of Master branch
My commits on the Git tree are out of the master branch. 我在Git树上的提交不在master分支中。 The result of this is when I push to my central repository the commits that are out of the master branch don't get pushed.
结果是,当我将其推送到中央存储库时,不会推送master分支之外的提交。
Here is a image of what I'm talking about: 这是我正在谈论的图像:
What can I do to have the commits without branch inside the master branch? 我该怎么办才能使master分支内没有分支的提交?
Best Regards, 最好的祝福,
Enter this into a command prompt/terminal: git branch -f master HEAD
将其输入命令提示符/终端:
git branch -f master HEAD
This resets the master
branch to HEAD
, but since master
already exists, it requires the force ( -f
) parameter. 这会将
master
分支重置为HEAD
,但是由于master
已经存在,因此需要force( -f
)参数。
After this, check out the master
branch by executing git checkout master
and then you can push your changes and your future commits will be made on the master
branch. 之后,通过执行
git checkout master
签出master
分支,然后您可以推送更改,将来的提交将在master
分支上进行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.