lannyboy
lannyboy

Reputation: 843

how to git filter-branch from intermediate code even there are git status

I want to copy changes & history from repo A to repo B.
So I went through http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ tutorial.
However I am stuck at git filter-branch command, as it told me:

Cannot rewrite branches: You have unstaged changes.

When I do git status, there are changes but I don't want to get latest from repo A. I want somewhere around a date and then copy it over to repo B.
How can I possibly do that?

Upvotes: 2

Views: 59

Answers (1)

VonC
VonC

Reputation: 1327324

At least, try again with a fresh clone of the repo A.

That way, you are sure there is no unstaged changes at all (and you preserve whatever is in your current repo A)

Then you can proceed extracting a folder from A into its separate repo, before merging it into B.

Upvotes: 1

Related Questions