We had a Gitlab CE on a vm in our server.
There were 3 people working on a single repository on this Gitlab server.
This Gitlab CE vm has been deleted accidentally!
These 3 people still have their local repositories with a lot of branches.
Our branching strategy was like this:
We had a Master branch and some feature branches per user.
users used to:
Now, I have some questions:
Create an empty repo in GitLab/BitBucket/GitHub.
Add a new remote (say, another
) in your current repo with the URL of the new repo. Then push your master
branch commits/changes to another
repo's master branch.
$ git remote add another <new-repo-url>
$ git remote -v # see if the remote is added correctly
$ git checkout master
$ git push another master # push the changes to another/master
If you need features of another branch (say, feature
) then simply checkout
to the feature
branch and push the changes to another
repo's feature
branch.
$ git checkout feature
$ git push another feature # push changes to 'another' repo's 'feature' branch
Push all the branches
and tags
to another
repo.
$ git push --all --tags another
N.B. Here, another
represents your new repo's URL.