Clone some remote branches and push them to a new repository?
I have a
development and an
experimental branch inside
old_repo. How do I clone only
new_repo? Basically, I want to clone
new_repo, but without the
old_repo, fetch all other branches (
old_repo is URL,
origin the resulting alias)
git clone old_repo my_repo cd my_repo git fetch
Check out both branches to make sure we have a local ref of them
git checkout master git checkout development
new_repo to remotes (
new_repo is URL,
new the alias), then only push
git remote add new new_repo git push new master development
Read more... Read less...
Create a new empty repository
mkdir new_repo cd new_repo git init
Add the new old remote
git remote add old_repo url...
Fetch only the the relevant branches
git fetch old_repo master:refs/heads/master git fetch old_repo development:refs/heads/development