Assume you're developing a project that can save images uploaded by user. You're using some version controle system like github or bitbucket and store all user's files in
app.use(express.static(path.join(__dirname, 'public')));
To have some initial data you're put some files in public/upload folder. Than you push this to a remote repo, that uses your app server for deploying. Server uses this commands to get latest version of the app.
git fetch --all
git reset --hard
How to avoid overriding files in this 'public/upload' directory every time you're pushing new version of the app?