Weekly assignments and final projects will be submitted through GitHub.
Each week, you’ll create a private repository, visible to you and the instructors, with the link provided on Slack. Please do not post assignments to a public repository.
HTTPS
selected and click the copy icon to copy the url.cd
into the directory where you want to put your assignment. For example,
$ cd ~/Documents/iOS
$ git clone <URL>
In Terminal, cd
into your repository. Two branches have been created for you: master
and development
.
development
branch.
$ git checkout development
As you’re working on the assignment, make sure to add, commit and push your changes to GitHub periodically.
Make sure you’re on the development
branch when you’re working on your project. An asterisk next to the branch name indicates the current branch.
$ git branch
* development
master
If you’re not on development
, switch to it.
$ git checkout development
Switched to branch 'development'
Work on your project in Xcode. Once you’re at a good stopping point, switch back to Terminal.
Check the current status of your branch.
$ git status
On branch development
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
Stage the changes you want to commit. Usually, you will want to stage all of your changes.
$ git add .
If you only need to stage certain changes, you can specify the file name.
$ git add README.md
Commit your changes to your local repository.
$ git commit -m "Update README"
Push your changes to your remote repository on GitHub.
$ git push
When you’re ready to submit your assignment, open a pull request from the development
branch into master
.
Pull requests
tab on GitHub. Click on New pull request
.base: master
and compare: development
.Create pull request
. Give your pull request a title, such as “Assignment 1”, and click Create pull request
again.If you need to make changes to your assignment after creating the pull request, but before the deadline, you can commit and push changes as usual. GitHub will update your pull request automatically.