0

I want to clone a specific commit, from one repo, to a second repo, and continue developing on the second one without affecting the first one in any way. I just need the starting point and then I want to have nothing to do with the first one.

The second repo already has some development on it, which I'd like to keep, so the new copied commit, corresponding to the commit I need from the first repo, would become the new master.

Is this possible?

As of right now I haven't tried anything since I'm concerned I might break something in both repos.

  • 1
    There is no such thing as "clone" a _commit_. What is it that you _really_ want to do? Do you mean you want the state of repo 2 to look exactly like the state of repo 1 in that commit? Do you have all the same files in both repos? – matt Feb 20 '23 at 14:38
  • Yes, I think you phrased it better. No, I do not have all the same files in both repos. – paduchele007 Feb 20 '23 at 14:44
  • Cool but I'm still not clear. Do you mean that the second repo is currently empty and that you want to use this commit/state as the starting commit/state of the second repo? – matt Feb 20 '23 at 14:45
  • The second repo is not empty. As I mentioned, there's some work there that I'd like to keep. What I would like, is to have that specific commit from first repo, as my master from now on, on the second repo. I hope it's a bit clearer now. – paduchele007 Feb 20 '23 at 14:52
  • Okay, I suggest this is the same as https://stackoverflow.com/questions/3816040/git-apply-changes-introduced-by-commit-in-one-repo-to-another-repo – matt Feb 20 '23 at 15:32
  • Yeah, that's essentially what I needed, thanks. – paduchele007 Feb 22 '23 at 18:54

0 Answers0