g-217
g-217

Reputation: 2210

Git commit branches after changing origin

I have clone cef repo as:

git clone https://bitbucket.org/chromiumembedded/cef.git

And it has several branches too, which can be checked by running

> git branch -a
* (HEAD detached at origin/3202)
  master
  remotes/origin/3202
  remotes/origin/3239

Now I want to commit this repo to my own git repo by changing the remote URL as:

>git remote set-url origin [email protected]:g-jha/cef.git
>git remote -v
origin  [email protected]:g-jha/cef.git (fetch)
origin  [email protected]:g-jha/cef.git (push)
> git push -u origin master
> git push -u origin origin/3202

But I only see master branch in my repo. branch 3202 cannot be seen in drop down. enter image description here

Upvotes: 0

Views: 55

Answers (1)

g-217
g-217

Reputation: 2210

Following link helped me: https://github.com/aiidateam/aiida_core/wiki/How-to-migrate-from-BitBucket-to-GitHub

I just needed to clone and push the repo with --mirror option.

>git clone --mirror https://bitbucket.org/chromiumembedded/cef.git
>cd cef.git
>git remote set-url --push origin [email protected]:g-jha/cef.git
>git remote -v
origin  https://bitbucket.org/chromiumembedded/cef.git (fetch)
origin  [email protected]:g-jha/cef.git (push)

>git push --mirror

Upvotes: 1

Related Questions