简体   繁体   中英

Un tracked files are being deleted every git push

To avoid mixing our staging properties and our production properties, we maintain a properties template file which is part of the repository. For each instance we create a properties file using the template, with the specific values and add the properties file to the .gitignore list.

I tried to do the same with an openshift. I created the properties files to app-root/repo instance but it looks like before the git push this directory is being deleted.

Is there another way to do it?

Every time you git push to openshift your app-root/repo directory is deleted. You should create those files inside your app-root/data ($OPENSHIFT_DATA_DIR) directory, then create symlinks either in your git repo, or in a deploy action_hook to those files from wherever you need them in app-root/repo, similar to how it is done in this file for wordpress for the uploads directory etc: https://github.com/openshift/wordpress-example/blob/master/.openshift/action_hooks/deploy

Did you git add the files and directories that you want to be tracked by git?

You might also want to check the .gitignore file as well as your git index to ensure files are not exlucded via git update-index --no-assume-unchanged <file>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM