2

I am working in a company which now adds a new worker to help me to work with my existing Xcode project. As I understand, it will require both of us to work in a team using Git or SVN.

1) How do I convert my existing project to have local/remote git? (I have opened my project WITHOUT including a local git to it).
2) Maybe I misunderstand, but if I include my project to a remote git, i.e. to github repository, does not it mean everyone in the world will see my code? I need only me and the new worker to see and work on the code. This is a private project. How do I do it properly?

I will be working in a team for the first time developing an iOS application, so I am sorry for such beginner's questions :)

Please advise.

Thanks!

user-123
  • 874
  • 1
  • 13
  • 34

1 Answers1

2

1) How do I convert my existing project to have local/remote git? (I have opened my project WITHOUT including a local git to it).

to initialize git repository just go to project folder in Terminal and run

git init

it will create local git repository for you and you can commit your code in it. To 'connect' it to remote repository run

git remote add origin URL_TO_REPOSITORY

and then push your changes

2) Maybe I misunderstand, but if I include my project to a remote git, i.e. to github repository, does not it mean everyone in the world will see my code? I need only me and the new worker to see and work on the code. This is a private project. How do I do it properly?

To have private repository on Github that can be shared only with your team members you need to subscribe to some of its paid plans. There's also some other options that provide free private repositories, e.g. Bitbucket

Vladimir
  • 170,431
  • 36
  • 387
  • 313
  • Thanks! and what is it about .gitignore file? how do I create it and where? – user-123 Feb 06 '13 at 14:29
  • @AnatolyAnatoly, for examples of .gitignore you can check http://stackoverflow.com/questions/3066698/what-is-the-standard-content-of-gitignore-for-an-iphone-xcode-project and http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects. file should be located in the root folder of repository (i.e. on the same level with .git folder) – Vladimir Feb 06 '13 at 14:47