Skip to main content

Getting Started with Git and GitHub

When you are writing software code and/or scripts, it is helpful to keep a history all your changes. Then if you make a mistake or aren't happy with the direction your code is heading, you can go back to a previous version. One efficient way to do this is via a version-control system.

Using simple commands, you can track all changes that you make. These changes will be stored in a hidden repository on your computer. But it is also very useful to store your repository in a remote location like GitHub. This serves at least two purposes: 1) backup and 2) sharing. If your computer crashes, you will easily be able to get your code back if it is stored online. But it also enables you to share your work more easily with others. If you wish, you can restrict access to your online repository while you are actively developing. Then when you are ready to share it with the world, you can easily do so.

For simple needs (updating and retrieving code), Git is easy to use and can be automated. But it also provides extensive advanced options for those who want to use them. Here is a simple overview of the basic commands you would use. But you can also find many other tutorials on the Web as well as books to help you along.