Currently iOS projects mainly ignore temporary files, configuration files, or generate files, and so on different development side these files will be very different, if git Add. Pushing these files to the remote will cause frequent changes and commits on different development sides. Steps:
1. Under the project catalog
2. Touch. Gitignore//Generate. gitignore Files in Directory
3. Open. Gitignore//opening. Gitignore (TXT) file
4. Write Ignore Directory
4.1 iOS projects here, usingCocospodsThe Framework management tool generatesPodfile、Podfile.lock、PodsFolders, and. XcworkspaceFour. which
above except
Podfile
, the other three files are not required to be submitted.
"Where
Pods
There is no need to submit the directory, the documents are based on
Podfile
Describes the library-dependent configuration information that is downloaded and generated by the file.
Because
CocoaPods
The semantic version number is supported, so you need to
Podfile.lock
The file remembers the version that is currently in use, and of course this file is not required. However, the benefit of submitting this is that you can remind people inside the team that the library version has been updated. "(1) We now configure settings to ignore the dependent library cache directory pods/ Omit the directory as follows:
#CocoaPodsPods
# xcode## Gitignore contributors:remember to update Global/xcode.gitignore, Objective-c.gitignore &swift.gitignore# Mac OS X Finder and whatnot. ds_store## Build Generatedbuild/Deriveddata/# # Various Settings*. Pbxuser!default. Pbxuser*. Mode1v3!default. Mode1v3*. Mode2v3!default. Mode2v3*. Perspectivev3!default. Perspectivev3xcuserdata/# # Other*.moved-aside*. Xcuserstate*. xccheckout## OBJ-c/Swift Specific*. Hmap*. IPA*. Dsym.zip*.dsym
(1) and (2) put together to form my. gitignore file
(3) But if you need to ignore the file conception exists in the far end, then you need to delete the files in the far end to be able to:
Pods //To delete
Git rm–cached the file. Ds_store is removed from the GIT index library, but to the file. The ds_store itself does not do anything, that is, local or there is a. ds_store file, but the far end has no
So that you don't have to worry about this file conflict anymore.
Reference 1. HTTP://WWW.CNBLOGS.COM/SHAYEBLOG/P/5359849.HTML2. https://segmentfault.com/q/1010000003041610
IOS builds a project filtering mechanism--adds ignore files to the project. Gitignore