0

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?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Martin Petercak
  • 833
  • 1
  • 9
  • 11

1 Answers1

2

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.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • so basically if I remove -f git will not do anything that I might not like? – Martin Petercak Sep 03 '12 at 12:23
  • yes, but that's only in a first time to make sure everything is OK. Later on when you're sure, use it so that deplyment occurs correctly, since checkout must be forced so that all things happen automatically. – CharlesB Sep 03 '12 at 12:32