Skip to content

Advanced Version Control

A Nice Git Exersice

Read about the Github flow here.

When you are done reading, let's practice using the Github flow a bit.

  1. On the left side of the bottom bar in VSCode, click on "master" and then "+ Create new branch" and name it whatever you want.
  2. Stage, commit, and push the changes you made in the previous pages. (You may want to refer back to the Version Control page of Section 2 to refresh on how to do that).
  3. Go to the repo for your project on Github and create a new pull request with the branch you just created. (make sure you're logged in)

In the pull request, people can add comments, review the code, and merge the code into our master branch. This is how we make sure all the code that we put on our robot works and meets our quality standards. We won't be merging your code in this time around, but let a programming lead or mentor know once you get to this step so we can check what you've learned.

Good Git Practices

  • Delete branches which are no longer relevant or do not contain unique code.

  • Add details into your commit message.

A commit called "Update Motors" does not help anyone. Give it a title of what you did, and use the message space to actually go into detail about the changes (if needed).

  • Use GitHub Desktop, or, alternatively, git from the command line for comfortable programmers.

This is because VSCode's "Git" window does not have all the features of actual GitHub (such as commit messages) and because GitHub Desktop gives a more organized way to create branches, merge, view changes, etc. compared to VSCode.