git-mv

Handling file renames in git

寵の児 提交于 2019-11-26 11:27:01
I'd read that when renaming files in git , you should commit any changes, perform your rename and then stage your renamed file. Git will recognise the file from the contents, rather than seeing it as a new untracked file, and keep the change history. However, doing just this tonight I ended up reverting to git mv . > $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html # Rename my stylesheet in Finder from iphone.css to mobile.css > $ git status # On branch master # Changes to be committed: # (use "git reset HEAD

Handling file renames in git

旧城冷巷雨未停 提交于 2019-11-26 02:26:16
问题 I\'d read that when renaming files in git, you should commit any changes, perform your rename and then stage your renamed file. Git will recognise the file from the contents, rather than seeing it as a new untracked file, and keep the change history. However, doing just this tonight I ended up reverting to git mv . > $ git status # On branch master # Changes to be committed: # (use \"git reset HEAD <file>...\" to unstage) # # modified: index.html # Rename my stylesheet in Finder from iphone