Ronaldo Nascimento
Ronaldo Nascimento

Reputation: 1571

How to import Xcode Swift Playground into GitHub?

I have an Xcode 8.2.1 Swift Playground on my local device. Can I import it into a new GitHub repo?

Its not currently under source control, and I can't seem to be able to create a git repo from within Xcode.

Should I just use the Terminal and change to the .playground directory and do a git init, commit, remote add origin and push? If I do that will Xcode recognize its under source control?

There seems to be no option to add a new Playground into source control on Xcode.

Upvotes: 3

Views: 2792

Answers (1)

Chris C.
Chris C.

Reputation: 80

I had this same issue this morning and found this article: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

It's a step-by-step guide for adding files to GitHub using the method you were describing. I created the repository from the GitHub UI then I made sure my playground was in a folder by itself and ran the commands from that location in the terminal. As of now, there's no indication to me that the XCode recognizes the playground as being under source control, but my playground did successfully get pushed to my pre

Hope that helps.

Upvotes: 1

Related Questions