‘Git’ along, coder dogies!

When working on nontrivial coding projects, it’s often helpful to be able to keep track of changes made, version by version. When more than one developer is involved, it’s also helpful to be able to coordinate updates among them.

Several version control solutions have been developed over the past couple of decades or so. One of the most popular ones for open-source projects is git. Developed by Linus Torvalds (of Linux fame), git allows version tracking of software projects (or really, any file-based project.)

Here are my initial impressions as I start using git. Disclaimer: I am a git newbie; while I have a reasonable understanding of what version control in general and git in particular are about, I am by no means an expert.

To start using git, a git client must first be installed. Traditionally, this is git for Linux, but I decided to try out git starting with a chip tester project written in PIC assembly, so I installed the GitHub client for Windows. (GitHub is a central service which can store open-source projects free of charge, and/or private, closed-source projects for a subscription fee.)

A git “repository” (project) is started by creating a local repository (the directory in which the files will reside, along with a few small files describing the repository contents.) These files contain the repository name, a brief description, and usually a list of files to include or ignore when updating the repository online.

Once the source files have been added, they are staged and then “committed.” This creates a “commit,” which is a snapshot of the project at that point. (It’s advisable to have the project in a reasonably stable state, when performing a commit.) At that point, other developers can “clone” the repository, to pick up a copy of the entire project.

The git client also tracks which files have been updated since the last commit. If, for example, a bug was fixed in an include file and the README file was updated, the git client would flag these as having been changed. Once the changed (and/or new) files are selected and a commit comment is entered, the main repository can be easily updated.

If you work with PIC microcontrollers and want to try out a (very pre-alpha) chip tester, you’re welcome to check out the repository I created.

“Share and enjoy!”

This entry was posted in C, Coding, Digital Citizenship, Internet, Linux, System Administration and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply