Moving files in Git
Posted: Thu Jun 20, 2019 8:19 pm
Recently a lot of files have been, and are being, moved around into subfolders etc.
This is making it really difficult to backtrack and follow the history of files which on a project this long lived is really important for tracking bugs and functionality.
There's an easy way to avoid this being a problem though, because Git can handle files being moved, it can detect them if they're identical before and after the move so long as they're committed immediately.
So I'm asking if we can follow this process for moving files around:
1. Do NOT change the files in any way
2. Move the unchanged file to the new location
3. Commit the moved files immediately
4. Then fixup the files for their new location or make any other changes!
If we do this, and if it works, then following changes back through the history of the files should be much easier.
What do people think?
This is making it really difficult to backtrack and follow the history of files which on a project this long lived is really important for tracking bugs and functionality.
There's an easy way to avoid this being a problem though, because Git can handle files being moved, it can detect them if they're identical before and after the move so long as they're committed immediately.
So I'm asking if we can follow this process for moving files around:
1. Do NOT change the files in any way
2. Move the unchanged file to the new location
3. Commit the moved files immediately
4. Then fixup the files for their new location or make any other changes!
If we do this, and if it works, then following changes back through the history of the files should be much easier.
What do people think?