Home CPSC 240

Lab 14: Github Setup



To set up a Github repository for your team project.



Using Github will allow you to more easily share code between team members and keep your project in sync. In order to set this up, you will need to do the following:

  1. Everyone needs to configure Git with your name and email address. Instructions on doing this are here on the CPSC 225 site. You should probably also do the other configurations suggested in that section.
  2. Everyone on the team needs to make a Github account, if you do not already have one. Instructions on this can be found here. Make sure to also do the steps where you create an SSH key and add the key to Github. This is how Github will know that you are who you say you are when it comes time to share your work.
  3. One person on the team should make the central repository. The instructions for doing so are further down on the same page as above. You can make the repository public for this project. This step also includes inviting your team members to the project. You will need to put in their Github user names to be able to find them. This gives them permission to make changes to the code in this repository.
  4. Everyone should clone the repository into their virtual machine. The 225 website also has instructions on this step. This will download a copy of the repository to each person's terminal and allow you to edit it.
  5. Everyone should test to make sure that they are able to push changes. To do this, do the following with your team:
    1. Have one person make a file called "AUTHORS" for storing the names of the people working on the project. This person should write only their name into the file. Then add this file with "git add", commit it with "git commit", and push it with "git push". That should send it to the Github repository.
    2. The next person should perform a "git pull" command which should download the AUTHORS file into their VM. They should add their own name to this file and then do the "git add", "git commit", and "git push" sequence to send the update to Github.
    3. Repeat step B for all team members who haven't put their name in the file yet.
    4. Finally, everyone should perform a "git pull", which should download the newest version of AUTHORS with everyone's names. This ensures that everyone has both read and write access to the repository.
  6. One person should copy all of the files from the first stage of the dungeon crawler assignment into the repository's folder. They should then add them, commit them, and push them to Github. If you refresh your Github project page, it should show all of your files so far, including AUTHORS.
  7. Everyone else should perform a "git pull" command to download this initial version of the project. You should now all be able to make changes, and share them with your team members.


Using the Repository

As you work on the project, you should follow the basic steps for working with Git:

  1. Start with git pull to make sure you are up to date before making any changes of your own.
  2. Work on the project until you are at a point where you want to save your work.
  3. Perform a git commit -a to save your work into your own repository. If you've made a new file, use git add to add the file as well. You can make multiple commits to your own repository before sharing with your team.
  4. When you want to share your progress, use git push. This sends the code you've worked on to the central repository. Next time your teammates do a git pull they will get your new stuff.
  5. Repeat!



For this lab, you should email me the URL of your Github repository. Everyone on the team should do this for the lab which will tell me that each person has Github set up correctly and is ready to contribute!

Copyright © 2019 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.