The gitignore template for Xcode, IntelliJ Idea and Phonegap (aka Cordoba)

Does anyone have a good ready-made gitignore file for developing iPhone using Xcode and PhoneGap?

I am currently using:

.idea .DS_Store *.swp *~.nib build/ adhoc/ .xcodeproj/ !*.xcodeproj/project.pbxproj *.mode1v3 *.mode2v3 build/ xcuserdata 

But I'm not sure if this is perfect. For example, updating Phonegap kinda causes a lot of things. Also, if another developer is just creating a project using Xcode, then git will get some changes.

Oddly enough, Xcode does not appear on this list: https://github.com/github/gitignore

+6
source share
3 answers

I ended up with this .gitignore config, which worked fine:

 .idea .DS_Store *.swp *~.nib build/ adhoc/ .xcodeproj/ !*.xcodeproj/project.pbxproj *.mode1v3 *.mode2v3 build/ xcuserdata 
+5
source

Here's an updated version of the .gitignore sample for Xcode iOS and OSX projects I did a few years ago, which excludes many things from the archive that are not needed for archiving, and which you may not meet often or notice when they slip. It should be quite complete. It includes temporary files from various editors and user preferences files from Xcode and its ancestors. (You may not see them often, but they appear from time to time in projects with deeper roots or if you are working with a new team member who likes a different editor.)

.Gitignore example for Xcode iOS and OSX projects

 # Mac OS X Finder and whatnot .DS_Store .Trashes # Sparkle distribution Private Key dsa_priv.pem # Xcode (and ancestors) per-user config *.mode1 *.mode1v3 *.mode2v3 *.perspective *.perspectivev3 *.pbxuser # Whitelist the Xcode defaults !default.mode1 !default.mode1v3 !default.mode2v3 !default.perspective !default.perspectivev3 !default.pbxuser # Xcode 4 - Deprecated classes *.moved-aside # Xcode gcc *.hmap #JetBrains AppCode .idea/ # Generated files VersionX-revision.h # build products xcuserdata/ DerivedData/ build/ adhoc/ *.[oa] # CocoaPods Pods/ # Other source repository archive directories .hg .svn CVS # automatic backup files *~.nib *.swp *.lock *~ *(Autosaved).rtfd/ Backup[ ]of[ ]*.pages/ Backup[ ]of[ ]*.key/ Backup[ ]of[ ]*.numbers/ 
+1
source

You can also use Joe Blau gitignore.io

Or through the web-interface https://www.gitignore.io/

Or, by installing the CLI tool, it is very simple, just enter the following on the terminal:

Linux:
echo "function gi() { curl -L -s https://www.gitignore.io/api/\ $@ ;}" >> ~/.bashrc && source ~/.bashrc

OSX:
echo "function gi() { curl -L -s https://www.gitignore.io/api/\ $@ ;}" >> ~/.bash_profile && source ~/.bash_profile

And then you can simply type gi followd with all the platform / environment elements that need gitignore criteria for.

Example
Suppose you are working on a node project that includes grunt and you are using webstorm on linux, then you can type:
gi linux,webstorm,node,grunt > .gitignore (to create a completely new file)
or
gi linux,webstorm,node,grunt >> .gitignore (add / add new rules to an existing file)

bam you can go

0
source

Source: https://habr.com/ru/post/916329/


All Articles