.gitignore file, where should I put it in my xcode project?

后端 未结 6 2064
无人共我
无人共我 2021-01-29 22:04

I want git to ignore my UserInterfaceState.xcuserstate file in my XCode4 project, but where should I put the .gitignore file?, is it inside the .

6条回答
  •  醉梦人生
    2021-01-29 22:21

    You can have a .gitignore in every single directory of your project.

    However, the best practice is to have one single .gitignore file on the project root directory, and place all files that you want to ignore in it, like this:

    ignoredFile.whatever
    ignoredDirectory/*
    directory/ignoredFileInsideDirectory
    .svn
    

    Once you create the .gitignore file, the ignore files that have changes or are new into the repository will not be shown to as waiting for commit.

    You can also have one global local git ignore file, that will manage all of your git repositories.

    git config --global core.excludesfile ~/.gitignore_global

    This alternative is particularly interesting for ignored files that are non-project related, such as IDE related files and so on.

提交回复
热议问题