After getting past a few hurdles learning Git, I came across a new challenge: Renaming a directory (locally, in the working directory).
When I type git status<
All answers here were very helpful on the way to the actual solution for the particular scenario I was facing. I am providing what worked for me in the form of actual steps, hopefully helping others encountering the same challenge:
git mv
git status
(verify that all files
marked renamed, not "deleted")git commit -a -m "git mv
"
(this is a "fake" commit, to prepare
for the real rename in the next
steps)git branch
git_mv_20110708_1500_DO_NOT_USE
("fake" branch with timestamp
reminding that we only did this as a
workaround)/bin/rm -Rf
cp -Rp .../ .
(copy
over the actual folder with the
renamed name)git status
(most modified files
will now be marked correctly as
modified, not "deleted". Files that have been renamed will be
marked as deleted and added,
despite having the same content! -- repeated steps 1-7 for those files if rename tracking is needed for them too)git add
git commit -a -m "finally renamed
this folder"
git branch FOLDER_RENAMED
:)P.S. gitk
loves this, but Emacs
is still confused with the renames. :(