0

I need to copy an existing git repository to a new branch on an existing git repository I tried

git branch new_branch git checkout new_branch git remote add project url/to/existing/repo git fetch 

But it doesn't work, I need to preserve the commit history :)

2
  • Explain what you are trying to accomplish - it is probably not a correct way to do whatever you are trying to do. Commented Aug 16, 2013 at 22:01
  • Well, I have a project and I want to merge it to another project who have the same folder structure, maybe I can merge it at all, but I thought that was better create a branch for it. Commented Aug 16, 2013 at 22:46

1 Answer 1

1

So, you just want to fetch everything from your repo? Do that.

git remote add existing url/to/existing/repo git fetch existing 

and then add tracking branches for anything you care about.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.