I would like to start using git on a website that already has a lot of content on it (like tens of GB of videos and photos).
I have all the source codes (PHP, HTML etc.) stored locally on my computer.
I like this solution for git deployment but I’m afraid that git is going to delete the multimedia files on that remote server (if they are not in a repository git).
I have put folders with photos and videos to gitignore.
So the question is:
If there are files already in a GIT_WORK_TREE after you set up a bare repository, are they going to be deleted after you push? Or could they be deleted somehow?
On checkout Git won’t touch anything that is not tracked, so you’re safe.
You should maybe avoid the
-f(force) flag to the checkout command, so that if you have untracked files that get tracked in a push, git will ask you for confirmation to overwriting them.