Chris
Chris

Reputation: 587

Replace remote Git repo with local

I have a remote on GitHub with an old version of my site that's no longer in use. I've since made significant changes to the local copy and want to merge these changes in. Is there a way that I can do this and keep the history that's already in the remote repo.

Is it simply a matter of copying the old .git directory to the new project and doing a git push --force to replace the remote version with my local changes? I would like to keep the same remote repo (and its history) if at all possible.

Upvotes: 0

Views: 1942

Answers (1)

Gus Monod
Gus Monod

Reputation: 110

I think your question has already been answered just there.

Also, moving all files from one repo to another will keep the history of the destination repo (but not of the old one) so if you only need to keep the history of one of them, you can do it that way.

Upvotes: 2

Related Questions