Git工作叉与更新 [英] Git working fork with updates
问题描述
我不知道下面的场景是否可以用Git。
我把别人的仓库分开了。
我希望通过从初始存储库获取更新来处理自己的存储库副本。
偶尔,我想释放我的代码,并将请求发送到初始存储库。
我不确定这是否可能,如果是,请稍后介绍我该怎么做。
这是可能的,但是一些最佳实践会涉及:
- 在您自己的分支中进行修改(您可以推送到您的分支)
- 使用
git fetch upstream
(上游是引用您分叉的原始回购的远程名称) -
重新绑定您自己的分支更新的原始分支:
(请参阅git fork
git clone
?)git checkout myBranch
git rebase upstr eam / master
-
如果你做了PR,试着让它变小一点一些提交内容),专注于一个特定的功能,而不是做一个大的提交,并提交了许多提交和许多更改。
b $ b - doing your modification in your own branch (that you can push to your fork)
- updating the branches common with the original repo with a
git fetch upstream
(upstream being the name of a remote referencing the original repo you forked) rebasing your own branch on top of the updated original branch:
(See "git fork
isgit clone
?")git checkout myBranch git rebase upstream/master
if you do a PR, try to make it a small one (with a few commits in it), focus on a specific feature, rather than doing a large one, with many commits and many changes in it.
详情请参阅夫妇关于拉请求的提示。
I wonder if the following scenario is possible with Git.
I forked someone's repository.
I do want to work on my own copy of the repository with getting updates from the initial repository.
Occasionally, I do want to release my code and send pull request to initial repository.
I am not sure if this possible, if yes please describe shortly what should I do.
It is possible, but a couple of best-practices would involve:
See more at "couples tips on pull requests".
这篇关于Git工作叉与更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!