What should I include in the .gitignore file for S

2019-04-20 09:55发布

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?

2条回答
ら.Afraid
2楼-- · 2019-04-20 10:09

From the official github gitignore for Swift

## Playgrounds
timeline.xctimeline
playground.xcworkspace
查看更多
相关推荐>>
3楼-- · 2019-04-20 10:20

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.

查看更多
登录 后发表回答