Member-only story
Using GitHub and Xcode
As I continue down my path of iOS Development, I am constantly reminded of teamwork. From writing clean and readable code to providing excellent communication skills, there is a lot a developer can do to keep the flow swift. For us to be able to collaborate on existing projects, we create a Git Repository on a hosting service called GitHub. You will need a GitHub account and we will also be using the terminal. Let’s assume we have an example project made already in Xcode. We realized that we needed some outside help, or we just wanted to showcase our app, so we want to create a repository for this specific project.
- Go to GitHub and create a repository for this project
- Open Terminal and navigate to your project
- Once inside project folder, type: git init
- Type: touch .gitignore
- Type: open .gitignore and you can paste from this https://raw.githubusercontent.com/github/gitignore/master/Swift.gitignore and save this file.
- Back in Terminal, type: touch .gitattributes
- Type: open .gitattributes and paste: *.pbxproj binary merge=union
- Save the file and go back to terminal type: git add .
- Type: git commit -m “Initial Commit, or any other message you would like”
- Type: git remote add origin https://github.com/username/new_repo.git (if you have an ssh key, use: git@github.com:username/new_repo.git) where new_repo is the repository name