blog:odborny:2015-07-08-integrating_xcode_project_and_github:assembla
Obsah
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
- 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/
- Getting Xcode and GitHub to work together: http://www.pavley.com/2013/06/12/getting-xcode-and-github-to-work-together-like-besties/
Komentáre
blog/odborny/2015-07-08-integrating_xcode_project_and_github/assembla.txt · Posledná úprava: 2019/10/08 23:03 od Róbert Toth