Using Git

We'll be sharing computers and submitting code in this class. To move code around easily, we'll be using a common tool called Git. Our gitlab web interface is at http://wallace.academy.usna.edu. Get yourself a username and password you'll remember.

Creating a Project

You and your partners will share a project together, all being able to contribute to the code. After logging on to the gitlab...

  1. Click the pancake stack in the upper left for the menu
  2. Click "Projects"
  3. Click "New Project"
  4. Under the Project path, click the drop-down menu to change to the group named after your section
  5. Type in a project name - make sure you've checked the project description for any naming rules I've set
  6. Click "Create Project"
  7. If on a shared computer, skip the "Git global setup" steps
  8. Run through the instructions in "Create a new repository"
  9. Click on the gear icon in the upper right
  10. Click "Members"
  11. Add your partners as "Master"s

Starting for the day

If you haven't yet cloned the repository onto that computer, go to that project in gitlab, copy the URL, and run git clone <that URL>

If you had already cloned the repository, just cd into it, and run git pull.

Ending for the day

  1. Run git status
  2. Run git add on everything that has been modified or created. git add * will make sure you don't miss anything in your directory.
  3. Run git commit -m <some useful message saying what you changed that day>
  4. Run git push

Image courtesy MIDN Carson Chauvin