Does cf push respect the use of .gitignore?

試著忘記壹切 提交于 2021-02-05 05:58:05

问题


I'm using the .gitignore file below with the hope that when I push my application, the tmp directory and swap files will be ignored. That isn't happening though and now I am wondering if cf push even considers .gitignore?

*.swp
tmp/

Does anyone know if cf push takes a .gitignore file into consideration?


回答1:


The file .cfignore is used for that purpose -- it is not the same as .gitignore, but rather its analogy for the cf tool.

The reason for not using them for the same purpose is that you may have for example files that are used for your build (or even source code!) that go to Git but not to the Bluemix runtime, and alternatively, other files like credentials or configurations which are to be deployed with the app but still not go to Git. (You would use .cfignore to exclude the first set, and .gitignore in the other case.)




回答2:


I discovered that cf push does NOT use .gitignore rather it uses its own file called .cfignore that has to be placed at the root directory of the application you are pushing.

The rules for .cfignore and .gitignore appear to tbe the same. (one pattern per line) However since the .cfignore file must be at the root of the applicaiton the patterns in the file must take that into consideration.

Using the file above I am now able to push my application without all the .swp files or anything in my <application-root>/tmp directory.



来源:https://stackoverflow.com/questions/30175601/does-cf-push-respect-the-use-of-gitignore

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!