简体   繁体   English

再次分叉原始回购

[英]Fork again a original repo

I forked a repository and cloned it in my local environment, I did some changes in master and create a pull request to merge my changes with the original repo. 我创建了一个存储库并将其克隆到本地环境中,在master中进行了一些更改,并创建了一个pull请求,以将更改与原始存储库合并。

But, I have to correct a new bug and I don't want to correct this bug in master of my forked repo, I want to "fork again" in another branch and call it "bugXXX" and create another pull request just with changes to fix this specific bug. 但是,我必须更正一个新的错误,并且我不想更正我的分叉存储库中的此错误,我想在另一个分支中“再次分叉”并将其命名为“ bugXXX”,并仅通过更改创建另一个拉取请求修复此特定错误。

So, how can I fork again in another branch the original repo and fix the bug and create another pull request ? 那么,如何才能在原始分支的另一个分支中再次派生并修复错误并创建另一个请求请求?

Thanks. 谢谢。

There is some lack of detail in your question, but I think this is what you want to do. 您的问题中缺少一些细节,但是我想这就是您想要做的。

You don't have to "fork again". 您不必“再次分叉”。 Just create a new local branch, say fix-bugXXX : 只需创建一个新的本地分支,例如fix-bugXXX

git checkout -b fix-bugXXX

Fix the bug on this branch, add your changes and commit them locally: 修复此分支上的错误,添加更改并在本地提交:

git add file1 file2
git commit -m "Fix bugXXX"

After that, push this new branch to your own GitHub repository. 之后,将该新分支推送到您自己的 GitHub存储库中。 This will create the new branch fix-bugXXX on your GitHub repo as well. 这也将在您的GitHub fix-bugXXX上创建新的分支fix-bugXXX Assuming that you left things named by default, the command is: 假定您保留了默认情况下的名称,该命令为:

git push origin fix-bugXXX

In the end, just go to GitHub and create a new pull request from your fix-bugXXX branch to one of the original repo's branches. 最后,只需转到GitHub并从fix-bugXXX分支向原始存储库的一个分支创建一个新的拉取请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM