Aupajo Aupajo - 1 year ago 89
Git Question

How do I move a Git branch out into its own repository?

I have a branch that I'd like to move into a separate Git repository, and ideally keep that branch's history in the process. So far I've been looking at

git filter-branch
, but I can't make out whether it can do what I want to do.

How do I extract a Git branch out into its own repository?

Answer Source

You can simply push a branch to a new repository. All of its history will go with it. You can then choose whether to delete the branch from the original repository.


git push url://to/new/repository.git branch-to-move

Creating a new, empty repository can be done with git init.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download