Git and media directory commits

33 views Asked by At

I've just started using Envoyer with Bitbucket and one problem I have with a live project is the media directory to which users of the system upload different media. If I exclude it from the commits, then they will effectively be removed from the live project on deployment - if I keep them - then they will overwrite the existing ones. What is the approach for this sort of situation, where you only want to commit them first time and then ignore on each sub-sequent deployment?

1

There are 1 answers

1
trikoder_beta On

You can add .gitignore to the media directory:

# Ignore everything in this directory
*
# Except this file
!.gitignore