sourcetree 代码管理:忽略文件提交

参考链接:

忽略xcuserstate文件 - 简书

git代码仓sourcetree忽略.xcuserstate或.xcscheme等文件设置 - zk1947 - 博客园

https://www.cnblogs.com/zk1947/p/17037058.html

xcuserstate文件 记录xcode状态,一般不需要提交,需要进行忽略

一 :首先创建 gitignore 文件 

1.1进入需要创建的文件位置:直接创建.gitignore 结尾的文件

1.2或者编辑.gitignore文件如下

二:编辑.gitignore 文件

# Created by https://www.gitignore.io/api/objective-c

### Objective-C ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

# CocoaPods - Refactored to standalone file


# Carthage - Refactored to standalone file

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
.DS_Store
### Objective-C Patch ###


# End of https://www.gitignore.io/api/objective-c


xcuserdata/  也可以修改为:

* .xcuserstate

重启sourcetree