Adding remote upstream to git repo on bit bucket

回眸只為那壹抹淺笑 提交于 2019-12-08 20:46:43

问题


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

git remote add upstream git@github.com:<original_author_name>/<productname>.git

Here, git@github.com:<original_author_name>/<productname>.git is displayed on my github dashborad, Once I forked the 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?


回答1:


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

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




回答2:


Simply add it this way:

git remote add upstream git@bitbucket.org:YOUR-PROJECT-NAME.git

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




回答3:


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


来源:https://stackoverflow.com/questions/9062288/adding-remote-upstream-to-git-repo-on-bit-bucket

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!