Github - ndm736/ME433_2020 GitHub Wiki

Some of you may be familiar with Github already. If you are, make a repository and add me as a collaborator (ndm736).

Github is a website that helps with version control, specifically Git. There are other types of version control software, but the idea behind them is the same. Version control lets you track your changes and work collaboratively on the same project at the same time without accidentally undoing what your teammates are working on. Version control is used in most engineering firms, so you should be familiar with it. We will use just some of the most basic functionalities on Github, but hopefully it will inspire you to learn a little more about it.

First, go to https://github.com/ and Sign up. All of your code and projects will be associated with your Username, so make it something cool. Once you have an account, use the website to make a new Repository. A repository, or repo, is the folder that stores your project. Call it ME433 or AdvancedMechatronics or something that will make it obvious to me that it is for this class. Then, in Settings->Manage access, you can add me (ndm736) as a collaborator.

Next, use the Github Desktop application to clone the online repository as a folder on your computer (File->Clone repository...). This will make a folder on your computer (probably Doucments/GitHub/repo_name, feel free to move this anywhere) that will be our working directory. Every assignment will be a new folder inside of this repo.

There are two steps to making changes to your repo. First, you would make a folder, for example HW1, and put some stuff in it, like code. In Github Desktop, you would see a list of changes made to the repo. The first step is to "Commit to Master" these changes. This means that changes will be bookmarked at that point, so that you can go back to them if necessary. But Committing is only stored on your computer, not on Github. So after you make a Commit, the second step is to Push the changes, so that they are uploaded to your repo online, where they will be backed up and available to me and other computers.

You can think of committing and pushing as an extra step to saving your work, with the advantage of leaving a change history so you can always go back to previous versions. You must leave a Summary with every Commit, so give a little note to yourself about what you just did.

A few notes:

  • Save early, save often. This is a common mantra, and applies to git as well. Don't do the entire assignment and push only once, that defeats the purpose.
  • Your pushes are timestamped! That means I can see them. I'm not going to use this information for anything, but it is interesting to see patterns.
  • Github is really only meant for text based files, like code. But we will cheat and add images and pdfs.
  • It is difficult to delete files once they have been pushed. That is the whole point. Make sure you are posting appropriate content.
  • There is also a CLI (command line interface) for doing all of the git instructions. The Github Desktop app can't resolve all potential problems, sometimes it takes some command line work.

The more interesting features of git, including branching and merging, we will skip over, because you are the only one working on your repo. If you ever get stuck, just make a copy of your important files, delete the repo, and start over.