4.4 Managing Files
Now your repository is starting to come together. With one file, it’s pretty simple right now, but as it grows, some cleanup is necessary.
Files need moving, code needs to be copied around, and some of the everyday cruft from working with your project needs to be ignored.
Renaming and Moving Files
We all write flawless, bug-free code on our first pass. Right? Even though we would like to think that we do, we sometimes get things wrong. Naming a file incorrectly or putting it in the wrong directory is no exception.
You can move a file in Git by typing
git mv <original-file> <new-file>.
The command tells Git to create new-file with the existing
file’s content, and it keeps the history and removes
original-filename.
Your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access