project-folder/
.git
wp-admin/
wp-content/
wp-includes/
.htaccess
...
project-folder/
.git
public
wp-admin/
wp-content/
wp-includes/
.htaccess
...
- Keep away from the Internet my
.git
folder - Wordpress files separated in a sub-folder
- Keep Git history changes
- Hide from the Internet deployment scripts or project sensitive informations
-
Be sure you don't have files uncommitted, if not commit them before next step.
git status
-
In project-directory create
public
subfoldermkdir public
-
Move files with
git mv
exceptpublic
subfolder to avoid errorsfor 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
note that the original source of the reference link might be: this stackoverflow answer,
and after some reading and digging, I just take a little notes here:
git-filter-repo
git am
?rename detecting/inferring
, like:--find-renames
(well, actually already stated in the above git official old faq, however I had not catched ...not tracking file rename itself
design