I need to use a different Git repository for a database than what I started with. I know I can just unlink and relink to the new repository, but I don't want to lose the change history. How can I move it without losing the change history?
Comments
5 comments
-
This is a git question rather than a SQL Source Control question.
I've never done it before, but imagine starting somewhere like this would be your best bet:
https://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
-
Alex, are you theorizing that if I move it on the Git side of things (hopefully retaining history there), and then unlink/link in Redgate to the new repository, then it will still see the history within Redgate? If not, then this is also a SQL Source Control question.
-
I did a quick test of unlinking then linking back to the same exact repository. The history was still visible, and it also recognized my uncommitted changes, although I had to resolve conflicts (Keep Mine vs Take Theirs). So in theory, I'm hopeful it would be okay if I move to a different repository using the method in the link Alex provided.
-
Hi @Tim86!
SQL Source Control doesn't save the history of commits anywhere, it actually just pulls the history from your GIT repository.
So if you preserve the history in GIT (the article Alex shared looks quite hopeful), then SQL Source Control will be able to show the previous history as well. -
Sorry - I neglected to follow replies to this thread and just spotted your responses. Glad you got it figured out. Good luck!
Add comment
Please sign in to leave a comment.