12

When I first created my new repository at bitbucket I used the option of importing source from github (Import existing code). However that git repo has now updated and I would like to pull those changes and update my repo at bitbucket too. How can I do that?

C graphics
  • 7,308
  • 19
  • 83
  • 134

2 Answers2

34

You need to:

  • clone your BitBucket repo locally
  • add a remote referencing your GitHub repo

    git remote add github /url/of/github/repo
    
  • pull from that github repo

    git pull github master
    
  • push back to bitbucket

    git push -u origin master
    
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

I had the same issue. I have deleted the old repository from bitbucket and than i could reclone it/import it from github to bitbucket.

Simple like that.

eebbesen
  • 5,070
  • 8
  • 48
  • 70
Cohen
  • 944
  • 3
  • 13
  • 40
  • 1
    This would mean you would lose any changes you had made at bitbucket – Andy Jul 26 '17 at 19:42
  • that is correct! ii had all my info into git and created a bit account, just because i can hAve the code in private, without having to pay a fee. – Cohen Jul 26 '17 at 19:43