. Gitignore file

The.gitignore file is used to describe Git ignore rules. It is used to prevent you from submitting unnecessary files to version control, such as personal Settings, compiled files, etc. Generally only source code can be added to version control.

GitHub’s advice ignores the rules

Many obsessive-compulsive patients struggle to create.gitignore files after a project has been built. They often feel that the rules they have filled in are incomplete and that what they find online is not the same. GitHub has a collection of.gitignore file templates: github.com/github/giti…

It can be roughly divided into language and environment. The first level directory contains gitignore of various languages, and the Global directory contains Global Gitignore of various environments, such as system and development tools ignore rules.

IOS project configuration suggestions

Take developing iOS projects using Xcode on macOS as an example:

Gitignore file: objective-c: objective-c. gitignore: Swift: swif.gitignore. Create a.gitignore file in the project folder and copy the ignore rules for the corresponding language into it.

You need to configure a global ignore rule to ignore some files or folders automatically generated by the system. For example, macOS. DS_Store, see Global/ macos.gitignore. Create a.gitignore_global file in user directory ① and copy the ignore rules to it.

Another category of ignore rules is to ignore files generated by development tools, typically files that can be automatically generated, such as compiled binaries or user-specific preferences, without submitting to version control. For Xcode, see: xcode.gitignore. Development tool ignore rules can be written to global ignore files or to project-specific ignore files. However, in case you configure the global ignore file and the collaborator does not configure it and then submits unnecessary files to the repository, most people are used to writing the development tool ignore rules into the project-specific ignore file (2).

Note:

For macOS, the user directory is: /Users/ Your username. For Windows, the user directory is: C:\Users\ Your username

Gitignore () : xcode.gitignore () : xcode.gitignore () : xcode.gitignore () : xcode.gitignore () : xcode.gitignore () : xcode.gitignore () : xcode.gitignore () : xcode.gitignore (