ack
ack

Reputation: 14935

Moving git branch to another local repo

I have two git repositories at /trees/repo and /trees/repo_recovered. The recovered version was manually copied over from a dying computer. There is one un-pushed branch in this repo that I would like to move to /trees/repo. I could push this branch to the remote and then pull it down into the new repo, but I would prefer not to share this work yet.

How can I copy a branch (and all it's history) across the filesystem?

Upvotes: 2

Views: 271

Answers (1)

poke
poke

Reputation: 387687

You could add another remote repository which just happens to be locally available on your file system.

git remote add recovered /trees/repo_recovered
git fetch recovered

Upvotes: 4

Related Questions