3

I have existing project and I want to add it in "git local repository".

How can I do that ?

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
Devang
  • 11,258
  • 13
  • 62
  • 100

2 Answers2

4

Open the Terminal and go to your project directory – the one with *.xcodeproj.

  1. Type git init . to initialize a Git repository there.

  2. Now you don't want all the files under source control, so Git allows you to ignore some of them by including them in a file .gitignore. You can check this to find out

  3. Open the project and your task is done. However it would be better to head to the Organizer Window and do a commit of all the files.

Now your project is backed by a git repository.

Community
  • 1
  • 1
Deepak Danduprolu
  • 44,595
  • 12
  • 101
  • 105
  • But it will create user defined repository. I want to allow xcode4 to handle my repository automatically. If you remember that in xcode4 if you have checked for "git local repository". It will show source safe when you select your project. – Devang May 17 '11 at 07:33
  • Can you elaborate automatically? I don't think there is a difference in a way Xcode 4 treats a user created repository and an Xcode-generated repository. – Deepak Danduprolu May 17 '11 at 07:39
  • Can find few more steps at following link: Adding Git to an existing Xcode project (http://noblevelop.com/adding-git-to-an-existing-xcode-project/) – Thiru Jul 08 '12 at 14:58
1

It's pretty simple, assuming you've got git installed. http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/.

csano
  • 13,266
  • 2
  • 28
  • 45