Pregunta

I know there is some question raise on this subject but it gives me no real answer.

I would like to use GIT repositories to store my project and to make some branches. I was using GIT repositories on other projects in xcode 4 but in xcode 5 under meni

 Source control

I have onelly options

Check Out

I create repositories as Apple suggested but I can't commit my code.

If I understand correctly if I Check Out my code it saves into local repo?

¿Fue útil?

Solución

As described in "How To Use Git Source Control with Xcode in iOS 7", you could:

  • create a new project:

http://cdn4.raywenderlich.com/wp-content/uploads/2013/09/Screen-Shot-2013-09-24-at-6.22.37-PM.png

  • make sure to select the "create git repository" option

http://cdn1.raywenderlich.com/wp-content/uploads/2013/09/Screen-Shot-2013-09-24-at-6.22.48-PM-480x54.png

  • and then copy your source in that new repo.

For that project, you should see more than just "Check out" in the "Source Control" menu:

http://cdn3.raywenderlich.com/wp-content/uploads/2013/09/Screen-Shot-2013-09-24-at-6.34.47-PM-e1380066015693.png

Otros consejos

I just find a post https://stackoverflow.com/a/11021627/411936 which solves this problem. I worked for me. Hope it helps.

1.  Quit Xcode (not sure if this is necessary but I do it just in case)
2.  Run Terminal
3.  Get into the project folder directory
4.  find .
5.  Find the file that says "UserInterfaceState.xcuserstate" and copy the entire filename up to the ./
6.  echo "paste the UserInterfaceState.xcuserstate file here" >.gitignore
7.  cat .gitignore
8.  git init
9.  git add .
10. git commit -m "You can type a comment here like now under source control"

You now have a repository and your project is under source control

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top