Have time to sort out the basics.

1. Create a project code repository on Github, GitLab or code Cloud.

Note that the.gitignore template is set up.

2. Copy the URL of the remote repository to the local PC using Xcode.

Get a project folder for a local repository:

Shift + Command +. To view hidden files (again hidden).gitignore files are automatically created.

3. Create a project in this directory using Xcode. Get:

4. Ignore

Now, the.gitignore file will look like this:

.DS_Store .svn profile *.moved-aside #CocoaPods Pods/ ! Podfile ! Podfile.lock ## Build generated build/ DerivedData ## Various settings *.pbxuser ! default.pbxuser *.mode1v3 ! default.mode1v3 *.mode2v3 ! default.mode2v3 *.perspectivev3 ! default.perspectivev3 xcuserdata ## Other *.xccheckout *.moved-aside *.xcuserstate *.xcscmblueprint *.xcscheme *.xcworkspace ! default.xcworkspace DerivedData .idea ## Obj-C/Swift specific *.hmap *.ipaCopy the code

If the pod folder needs to be ignored, the# Pod/Take the # out of this sentence.

Any future code submission will ignore the dot xcuserState and. DS_Store files, Pods folder.

supplement

If the project is not empty, it is recommended to first backup the whole project (except the.git folder), create a remote repository, clone, copy the backup project into it, and then upload it.

Other information www.jianshu.com/p/7640bdcba…