Git & GitHub & GitHub Classroom
Git Resources
GitHub
Please be aware that we will be using github.com instead of github.mit.edu. You may find it more convenient to add your MIT email address(es) to your personal GitHub account (see this doc for more information) so that you can work more seamlessly across the two GitHubs with other classes.
SSH Tokens
In order to clone the repositories we provide to you and push your code to them, you will need to create an SSH token on your machine and add it to GitHub to verify your identity. Visit the keys settings page on GitHub and follow the instructions to add an SSH key.
Basic Git Commands
Clone: git clone <repository-name>
Add: git add <file(s)/directory/directories>
Commit: git commit -m <message>
Push: git push origin master
Tag: git tag -a v<number>.<number> -m "<commit message>"
git push origin v<number>.<number>
GitHub Classroom
We will be using GitHub Classroom to manage coding assignments, such as your portfolio, Fritter and the final project. This is the flow for those assignments.
- Make sure you are logged into your github.com account and not github.mit.edu.
- In the assignment page, under Submission, there is an assignment link. Follow this link to start the process of accepting the assignment and creating your repo.
- For an individual assignment, you will be prompted to accept.
- For the final project, you accept these by either creating or choosing a team.
- Your team name should be [partner1-github-username]-[partner2-github-username]-[etc…]. The usernames should be ordered alphabetically; for example, “alex-brenda-clara-diane”. The first person from your team to accept the assignment should create the team and others should look for the team in the team list and join.
- After you accept the assignment, a git repo will be created for you for the assignment and this is what you will use for submitting code for grading.
- Once your repo is created, go to the Settings tab of your repo, and change the repository name (under General) to match the form
portfolio-[kerberos]
(orfritter-[kerberos]
for the Fritter assignment). This is so the repo has an identifiable name. - After you are done with the assignment and all your code has been pushed (including a filled out readme.md if applicable), you will deploy your work, then go to your Jekyll site and add both the repo link and your site link.
We will also be using GitHub Classroom to give feedback on assignment code. Your final grades are posted on Canvas. Here is the flow for viewing assignment feedback on GitHub:
- Go to your repo and select the Pull Request tab at the top.
- Select the “Feedback” pull request (this is auto generated by GitHub classroom and randomly assigned to a staff. This should not be merged).
- In the “Conversations” tab, you will find a comment with your grades and general notes the TAs had.
- In the “Conversations” tab, you will also find inline code comments that TAs might have had. You can respond to these comments if need be.
- To see the TAs’ comments in the context of your code files, go to the “Files changed” tab and you will see your code and the inline comments the TAs might have added. You can also respond to the comments here if needed.
Other Git Resources
GitHub Classroom Tutorial (First 3 mins. You can watch the rest but keep in mind that the project shown is not for this class)
Another good place to brush up is your 6.1020 (6.031) course notes!