What should I include in the .gitignore file for Swift playgrounds?

懵懂的女人 提交于 2019-12-06 18:04:49

问题


I want to use Git for versioning my playgrounds, but I am not sure which files should be ignored and which ones I should commit.

Currently I use following .gitignore file for playgrounds:

# Xcode user data
xcuserdata

What else should be there?


回答1:


From the official github gitignore for Swift

## Playgrounds
timeline.xctimeline
playground.xcworkspace



回答2:


Whether it is a normal project or playgrounds, it is convenient and useful to use one of the standard .gitignore files for Swift. From the terminal cd into your project root folder (the one with the .xcodeproj file for a normal project) and run the following command:

curl -o .gitignore https://www.gitignore.io/api/swift

Or alternatively get it from the GitHub source:

curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Swift.gitignore

You can edit the file to make changes if you need to. I just use the defaults.



来源:https://stackoverflow.com/questions/31437170/what-should-i-include-in-the-gitignore-file-for-swift-playgrounds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!