I have two files which are called
- version1
- version2
Version1 has my own changes, while version2 is based on version1 but it has other people’s changes too.
I run the following command at my Git folder where Version1 is
git add version2
I now have two separate files in Git. I would like combine them now.
Which command should I run such that I have only Version2 and the history of Version1?
The best way to achieve what you are describing is to go in and change Version 1 with all of their changes and run the
That way Git will track those changes and create two versions of Version1 one being the original and one with changes.
If you want more separation than that I would create a branch since branches are so easy to do in Git.
You could one master or raw branch where you keep the originals, then one where you keep the changes.
it would look something like this
Hope this helps.