我可以在git上更新一个分叉项目到原始/主副本吗? [英] Can I update a forked project, on git, to the original/master copy?
问题描述
我可以先更新我的叉子吗?
如果在我开始更改之后叉子发生变化,会发生什么情况。我可以再次更新我的叉子,同时在那里留下我的更改(即合并,如果需要吗?)
可以将拉出
从原始仓库到您的货叉的更改。
来自GitHub的帮助:
>首先,向原始回购添加一个遥控器。
这里的帮助: http://help.github。 com / remotes /
然后,您可以更新原始回购协议。引用自 http://help.github.com/fork-a-repo/
拉动上游变动
获得更新后,您
可以通过运行以下代码将这些更新添加到您的分支:
$ git fetch upstream
$ git merge upstream / master
所有这些都是从命令行执行的。
下面是对TortoiseGit的说明:
右键点击您的项目 - > TortoiseGit - >设置 - >远程。
在这里添加远程详情:
现在,右键单击 - > TortoiseGit - > Pull。
您将看到一个对话框来选择遥控器(您应该能够看到您在上一步中添加的遥控器)。选择它并拉。
A few weeks ago i forked a public project on GitHub. Today, I wish to try some stuff on it BUT i want to make sure the copy I use is the most recent.
Can I update my fork, first?
And what happens if there's changes to the fork AFTER i've started my changes. Can i update my fork again, while leaving my changes in there (ie. merge, if needs be?)
Yeah you can pull
the changes from the original repo into your fork. Add a remote to it ( since origin will be your fork ) and pull.
This from GitHub help:
First up, add a remote to the original repo.
Help here: http://help.github.com/remotes/
Then you can pull in updates to the original repo. Quote from http://help.github.com/fork-a-repo/
Pull in upstream changes
If the original repo you forked your project from gets updated, you can add those updates to your fork by running the following code:
$ git fetch upstream
$ git merge upstream/master
All these are for doing from command line.
Below are instructions for TortoiseGit:
Right click over your project -> TortoiseGit -> Settings -> Remote.
Add the remote details here:
Now, right-click -> TortoiseGit -> Pull.
You will be presented with a dialog to choose the remote ( you should be able to see the remote you added in previous step). Choose it and pull.
这篇关于我可以在git上更新一个分叉项目到原始/主副本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!