-1

I git clone my old repository.

I list all branch:

$ git branch -r
  origin/HEAD -> origin/master
  origin/develop
  origin/master
  origin/release/1.1.0
  origin/support/1.0.0
  origin/support/1.0.2

I change url:

$ git remote set-url origin ssh://git@bitbucket.xx:1234/xxx-xxx/xxxxxxxx.git

I push code in new repository:

$ git push -f

My result is OK for master branch but I want all branch find by git branch -r. How to do please?

EDIT (but only master branch is present in my new Bitbucket):

I try

git push --all

I try

git pull --all
git push --all

I try

git pull --all
git pull --mirror
git push --mirror
git push --all
Stéphane GRILLON
  • 11,140
  • 10
  • 85
  • 154
  • 1
    Did you check on and try `git push --all` in the documentation? – fredrik Jun 11 '20 at 17:16
  • Does this answer your question? [How to change the URI (URL) for a remote Git repository?](https://stackoverflow.com/questions/2432764/how-to-change-the-uri-url-for-a-remote-git-repository) – matt Jun 11 '20 at 18:30
  • @matt, you link ask only one branch. I read this solution (use in my case), but I have only `master` branch in my new repository. – Stéphane GRILLON Jun 11 '20 at 20:13
  • @sgrillon I think if you look through the answers _and comments_ on that page, you will find that what you're asking is quite well answered. For example, it tells you about `git push --all`. – matt Jun 11 '20 at 20:26
  • @matt, I try `git push --all` but this command create a new branch named 'list'. (no push all branch to my new bitbucket): `[new branch] list -> list` – Stéphane GRILLON Jun 12 '20 at 07:41

1 Answers1

1

The reason they aren't being pushed is that these are remote branches that only exist on your original remote, not in your local repository (that's why the suggestions of git push --all aren't working).

As there are only a few, I suggest you simply checkout the ones you want locally and then redo the push. e.g.

git checkout release/1.1.0
git checkout support/1.0.2
git push --all

That will do it. There is a way to push all branches up, but I'd need to test it so this will fix the issue for now.

seumasmac
  • 2,174
  • 16
  • 7