esqew
esqew

Reputation: 44707

Create git repository after project creation

I know there's an option to make a local repository for your project when you first create it, but is there an option create a repository after you've created your project?

Upvotes: 14

Views: 5290

Answers (3)

Marco
Marco

Reputation: 324

You should go to your Xcode menu, click Source Control > Create Working Copy...

Xcode will automatically create your .git folder repository.

Good luck, and make sure you have a backup of your project before trying something else.

Upvotes: 4

elnino07
elnino07

Reputation: 47

In the command prompt, make sure you're in the desired directory and perform a git init and you will have created an empty repository.

You can then proceed to add the files and directories to the repository by doing

git add <filename1> <filename2> ...

or you can select whole directories and use * to act as a wild card of sorts.

git add ./*

If you have any more questions check out these pages:

Hope this helps.

Upvotes: 4

Greg Hewgill
Greg Hewgill

Reputation: 992737

Sure, just run the following command in your project directory:

git init

This will create the .git directory containing an empty repository. Then, add and commit your files.

Upvotes: 17

Related Questions