I am using the following steps to duplicate all branches to the new-repository.
git clone --bare https://github.com/exampleuser/old-repository.git
# Make a bare clone of the repository
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git
# Mirror-push to the new repository
Now, I have added two new branches in old-repository.git
and want to move only those 2 branches to new-repository.git
What git commands are required to perform it?
You can add new_repo as a remote for old repo: this is more convenient for pushing:
cd old_repo
git remote add new /path/to/new/repo
git push new newBranch1
git push new newBranch2