Github,我如何将我的分支同步到主服务器?

时间:2014-11-13 20:10:43

标签: linux git github

我刚刚开始使用git和github。

我分叉了一个项目,为它做出了贡献并创建了一个拉取请求。该拉取请求已合并。

与此同时,我分叉的项目已经进行了新的更改。现在我想抓住这些更改,以便我的分叉项目与项目负责人相同。

我该怎么办?点击此链接Syncing a fork没有用。

$ git fetch upstream
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

3 个答案:

答案 0 :(得分:1)

您没有添加名为upstream的遥控器。您可以通过执行git remote add upstream <git-repository-url>来添加它。当您在GitHub上的项目页面时,您可以在右侧找到git-repository-url,在那里它被称为clone URL。添加upstream遥控器后,您可以执行最初找到的步骤。更新fork时,rebase可以使历史更清晰。检查this anser,看看是如何完成的。

答案 1 :(得分:0)

尝试git pull。如果你在主分支上,或者git pull origin master。

答案 2 :(得分:0)

https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/尝试这样做:

git pull https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git BRANCH_NAME