Using Xcode preferences vs .gitignore file

时光怂恿深爱的人放手 提交于 2020-01-06 05:48:27

问题


I'm new to git repositories and have found lots of great support for creating a .gitignore file that I would put in each project directory.

However, I've noticed that in Xcode 10 preferences under Source Control under the git tab there is a spot to specify files to ignore. Is there an advantage to defining the exclusions in Xcode versus the .gitignore file? I can't seem to find anyone that actually does it this way and Apple docs are light.

Are there some items (maybe globals) that I would put be better putting in prefs?

Thanks!


回答1:


Are there some items (maybe globals) that I would put be better putting in prefs?

They should all be globals. There is probably no reason for you to have individual .gitignore files on a project by project basis. The Xcode 10 preferences to which you refer is merely another window onto your global .gitignore file. It is, after all, git that is to do the ignoring — not Xcode.

Your question seems to imply that you are not using a global .gitignore file. Use one. What I do is maintain this file in my home directory, and call it .gitglobalignores. The file is pointed to through the .gitconfig file (there's a good explanation of how to arrange that here). Whether you type out the file by hand in a text editor or manage it through the Xcode 10 preferences window doesn't matter.



来源:https://stackoverflow.com/questions/52906874/using-xcode-preferences-vs-gitignore-file

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