Consider the following cases:
-
The original file
foois not needed anymore but its content should continue to be used in N new files (e.g.barandbaz): -
The original file
foois still needed but parts of the content should be copied / moved to a new file (e.g.bar):-
First commit:
- Duplicate the content without any changes:
cp foo bar - Add the new file:
git add bar
- Duplicate the content without any changes:
-
Following commits:
- Apply arbitrary changes to the new file but you can't see the full history anymore:
- Blame bar
- Apply arbitrary changes to the new file but you can't see the full history anymore:
-
๐
-
First commit:
- Duplicate the content without any changes:
cp foo dummy - Add the new dummy file, remove the old file:
git add dummy,git rm foo
- Duplicate the content without any changes:
-
Apply the first option:
- Duplicate the content without any changes:
cp dummy foo,cp dummy bar - Add the new files, remove the old dummy file:
git add foo bar,git rm dummy
- Duplicate the content without any changes:
-
Following commits:
-
๐
-