将远程上游添加到位桶上的 git repo

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9062288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:24:31  来源:igfitidea点击:

Adding remote upstream to git repo on bit bucket

gitbitbucket

提问by Tarun

In case of GitHub, I added a remote named upstreamto pull in latest changes to my forked repo using:

在 GitHub 的情况下,我添加了一个名为的远程,以使用以下upstream命令将最新更改拉入我的分叉存储库:

git remote add upstream [email protected]:<original_author_name>/<productname>.git

Here, [email protected]:<original_author_name>/<productname>.gitis displayed on my github dashborad, Once I forked the repo.

在这里,[email protected]:<original_author_name>/<productname>.git显示在我的 github dashborad 上,一旦我分叉了 repo。

But in case of Bitbucket, I always see my forked repo location but not the original source from where I fork it from. Now how can I find the location of original repo which I could add as remote - upstream to pull in latest changes from original I forked?

但在 Bitbucket 的情况下,我总是看到我的分叉回购位置,但看不到我分叉的原始来源。现在如何找到可以添加为远程的原始存储库的位置 - 上游以从我分叉的原始存储库中提取最新更改?

采纳答案by VonC

If that information (the upstream repo address from which you have forked your own BitBucket Git repo) is reallynot available anywhere, try at list a pull request.

如果该信息(您从中派生出自己的 BitBucket Git 存储库的上游存储库地址)确实在任何地方都不可用,请尝试列出拉取请求

The pull request screen should display the candidate upstream repo name (that you can click to see its address).

拉取请求屏幕应显示候选上游存储库名称(您可以单击以查看其地址)。

BitBucket pull request

BitBucket 拉取请求

回答by adardesign

Simply add it this way:

只需以这种方式添加它:

git remote add upstream [email protected]:YOUR-PROJECT-NAME.git

Check out this article for more info: https://blogs.atlassian.com/2013/07/git-upstreams-forks/

查看这篇文章了解更多信息:https: //blogs.atlassian.com/2013/07/git-upstreams-forks/

回答by PositiveGuy

git branch --set-upstream-to=origin/<branch name you are working in locally  that matches the remote branch name>

git branch --set-upstream-to=origin/alui-git-feature1