Git: move files in an subfolder keeping history
project-folder/
.git
wp-admin/
wp-content/
wp-includes/
.htaccess
...
project-folder/
.git
public
wp-admin/
wp-content/
wp-includes/
.htaccess
...
.git
folderBe sure you don't have files uncommitted, if not commit them before next step.
git status
In project-directory create public
subfolder
mkdir public
Move files with git mv
except public
subfolder to avoid errors
for file in $(ls | grep -v '^public$'); do git mv $file public; done;
Move specific files like .htaccess etc...
git mv .htaccess public/
Commit changes
git commit -m 'Moved files to public/'
That's all !
git log -M summary
git log --follow
http://git-scm.com/docs/git-log
On logging file(s) you have to check [x] Follow renamed files