Reputation: 4257
I have created a iPhone project with option "Create local git repository for this project" enabled. Recently I created a github account. Now I want to directly commit my code to github, not to my local repository. How could I do this?
Upvotes: 0
Views: 431
Reputation: 22939
The git integration in Xcode is somewhat limited. And I personally only use it marginally. Technically you have to checkin your code into your local repository first, before you can push it to a remote repository (But some tools allow you to do both at once).
However, I can recommend using Tower for pushing your code to github. It has a simple interface and does most of the common git tasks very conveniently:
(source: git-tower.com)
If you want to use a free client there is also the native Github mac client which obviously works well with github.
If you need to do more advanced stuff you can always revert to the Terminal
BTW: If you're wondering how to push from your local repository to a remote in the terminal you might find the Visual Git Cheet Sheet helpful:
Upvotes: 1
Reputation: 2894
Pushing code using XCode always gives problem to me .So best option is to push code using terminal. below are the steps to push code to git hub.
open terminal set path to the project folder.
check for modified or new file using command git commit --dry-run . It will show you all the modified or newly added file .also some Xcode file.
add new files and modified files using git command git add "file1 path" "file2 path" .also don't forget to add .proj file if u have added new file or changed Xcode setting.
commit your file using command git commit. it will open message window. so you can enter message by pressing i. once you have written message press :wq
run command git push origin HEAD.
Upvotes: 0