8

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Tarun
  • 3,456
  • 10
  • 48
  • 82

3 Answers3

4

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/

adardesign
  • 33,973
  • 15
  • 62
  • 84
2

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).

BitBucket pull request

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
-2
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
PositiveGuy
  • 17,621
  • 26
  • 79
  • 138
  • 5
    Please elaborate on your answer. Posting code-only answers on old questions that already have other answers is not helpful. – Erik A Aug 19 '17 at 07:59