I have a project in repository 1 with commits A-B-C-D-E. I want to create a new repository (repository 2) with the same project but to simplify all the commits that were done, I would like to have repository 2 have commits B-E. Ie, I would like to create repository 2 starting from repository 1B. I would then update it in a single commit such that repository 2 would look like repository 1E (but would be done with a single commit). How can I copy repository 1B into a new repository (repository 2)?
Thanks in advance
Hi Beau,
That sounds like a complicated operation that I wouldn't recommend unless you're experienced with git. On a very high level, it would involve cloning the repo, revert changes to B, then copy-pasting this code file (not cloning as that would involve all the history) into a new directory and initializing a repo, then replacing the code file you just pasted by the completed code file (the file with all the changes from A-B-C-D-E) and commit this.
And most importantly, don't forget to take a backup of your original file in case things don't go as you expect.
Good luck!
Ana
Thank you, that seemed to work. One problem that I did run into when I was doing this however was the invisible .git file that kept record of the old commits. Just and FYI for anybody else who runs into this issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's definitely something to keep in mind, as most people will copy-paste the whole directory instead of each file individually ;)
Glad I could help you! Have a nice day,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.