====== Integrating Xcode project and GitHub / Assembla ======
This short article will guide you step-by-step through creating Xcode project with local and remote Git repository (GitHub or Assembla) using SSH public/private keys authentication on remote side.
===== Part I: Creating Xcode project and local repository =====
First part is really simple:
- Open Xcode
- Create new project: ''File → New → Project…''
- Check the "Create Git repository on My Mac" option during the project creation
- Change some files and try commiting the changes, everything should work well
===== Part II: Creating remote repository =====
Now, proceed to remote
- create repository
- generate SSH keys to access repository: ssh-keygen -t rsa -f path/to/private/key
- git remote add origin git@github.com:FurloSK/git-test.git
===== Part III: Connecting local and remote repositories =====
- TODO generate SSH keys
- Create ''config'' file in ''~/.ssh/'' directory: touch config
- Open the file: ''open config''
- Paste this text into file, edit the ''IdentityFile'' path to match path to generated private key and save the file: Host github.com
HostName github.com
User git
IdentityFile "~/Path/To/Private/SSH/key"
- Optionally, exclude files you do not want to be pushed to remote repository:
- Create ''.gitignore'' file: ''touch .gitignore''
- Open the file: ''open .gitignore''
- Supply line-divided array of excluded files and directories
- Sample file for Objective-C ''.gitignore'' file from GitHub is here: [[https://github.com/github/gitignore/blob/master/Objective-C.gitignore]]
- Finally, push last commited local changes to remote directory:
- in Xcode: ''Source Control → Push…''
- in Terminal: ''git push -u origin master''
===== Further reading =====
* ssh help: [[https://help.github.com/categories/ssh/]]
* assembla: [[http://stackoverflow.com/questions/26501262/xcode-6-source-control-with-assembla-fatal-repository-https-xxxsubversion-a]]
* Getting Xcode and GitHub to work together: [[http://www.pavley.com/2013/06/12/getting-xcode-and-github-to-work-together-like-besties/]]
* [[http://www.raywenderlich.com/13771/how-to-use-git-source-control-with-xcode-in-ios-6|How To Use Git Source Control with Xcode in iOS 6]]
* [[http://www.cimgf.com/2013/12/10/using-git-in-xcode/|Using Git in Xcode]]
~~socialite~~
{{tag>howto, manual}}
===== Komentáre =====
~~DISQUS~~