当Git与Xcode一起使用时,我应该在.gitignore中包含哪些文件?
当前回答
你应该结账给gitignore。用于Objective-C和Swift。
下面是我正在使用的.gitignore文件:
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xccheckout
*.xcworkspace
!default.xcworkspace
#CocoaPods
Pods
其他回答
如果有人需要一个标准的gitignore文件作为一个简单的方法。
在导航到项目后,在cmd/ terminal中运行这一行。
npx gitignore Objective-C
GitHub的人们为Xcode项目提供了详尽的。gitignore文件:
斯威夫特:https://github.com/github/gitignore/blob/master/Swift.gitignore
objective - c: https://github.com/github/gitignore/blob/master/Objective-C.gitignore
对于Xcode 4,我还添加了:
YourProjectName.xcodeproj/xcuserdata/*
YourProjectName.xcodeproj/project.xcworkspace/xcuserdata/*
对于Xcode 5,我添加:
####
# Xcode 5 - VCS metadata
#
*.xccheckout
选自Berik的答案
gitignore。io:为你的项目创建有用的gitignore文件
Example: Preview | Edit Programming Languages: Objective-C Swift Build Automation Tool: SwiftPackageManager Carthage IDEs: Xcode Operating Systems: macOS Steps to use in Terminal (Refer to the YouTube Video) Create Git global config alias (One time only) git config --global alias.ignore '!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi' Enter the project directory cd <the project directory> Generate .gitignore file git ignore Objective-C,Swift,SwiftPackageManager,Carthage,Xcode,macOS >.gitignore Add and commit .gitignore file git add .gitignore git commit -m "Add .gitignore file"
推荐文章
- 如何将git配置存储为存储库的一部分?
- 如何修改GitHub拉请求?
- keychain上的分发证书中缺少私钥
- 如何在Github和本地删除最后n次提交?
- 我如何调试git/git-shell相关的问题?
- Xcode的构建文件夹在哪里?
- 错误:无法使用rebase进行拉取:您有未分阶段的更改
- Git隐藏未缓存:如何把所有未分期的变化?
- 真实的恶魔
- Xcode 4在目标设备上说“finished running <my app>”——什么都没有发生
- 如何从另一个分支获得更改
- Git:权限被拒绝(publickey)致命-无法从远程存储库读取。克隆Git存储库时
- git reflog和log有什么区别?
- git推挂在Total line之后
- 重命名git子模块