In this tutorial, I will explain steps to setup git repo for To-do iOS app.
Let’s start with creating repository in GitHub. Open Github.com from your Safari and login. If you don’t have an account, please feel free to create one.
On the homepage, click on New button to create new repository. Now you have to name the repository. It’s better to use same name as your project.
Then select your repo visibility. If you set repo as private only you can view your repo. Don’t worry others can’t edit your code if you made repo public. Adding README.md in optional at this stage.
Now create new project using xcode. While creating project please refrain from allowing xcode to manage your git.
Then open terminal and go to project path. Create README.md file by entering following code in terminal.
echo "# This is ToDo app for iOS" >> README.md
Then Initialize git and add file to git.
git add README.md
Commit changes and add a message for better understanding of code change while debugging.
git commit -m "first commit"
Now we have to make our change in local repo to remote repo(Github)
git remote add origin firstname.lastname@example.org:saviosailas/ios_ToDo.git
git push -u origin master
Replace “email@example.com:saviosailas/ios_ToDo.git” with your git url.
If you feel managing git from terminal is not user friendly, you can try GUI version of git client from GitHub. 👨🏻💻
Download github client from https://desktop.github.com and Enjoy coding....