B
B
bboy2011-02-09 19:38:46
git
bboy, 2011-02-09 19:38:46

Git isolate branch to another repository?

There is a local git repository with several branches, it became necessary to freeze the development of one separate branch and remove it from the main repository.
How can I move this branch to another repository while keeping the entire history of this branch in the new repository?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
whitequark, 2011-02-09
@bboy

# add a new empty repository to the remote list
$ git remote add archive $ARCHIVE_REPO_URL

$ git push archive archive_branch
$ git branch -d archive_branch # delete the branch locally (optional)
$ git push origin :archive_branch # delete the branch in the main repository

W
whitequark, 2011-02-10
@whitequark

Well, usually where there are archive repositories, they are still managed centrally, so I meant by zero point "ask the admin to add an entry to gitosis / gitolite" or something like that. But yes, anything is possible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question