Wednesday, August 13, 2014

Git and GitHub - For Sotfware Development

Beware, this post may be contagious.

My confession: over the last few weeks I have become a "Git and GitHub Junkie" !

During my work career I have used several Software Development Tools. Most have had some sort of Revision Control, the simplest is no control at all, where files are backed up by the user. Others automate the process, and provide tools to allow the user to see the difference between revisions. In general, most just document the time line of a software project and provide a snap shot of the project when requested. That is, they provide a one dimensional view of a software project.

As an analogy comparison, Git and GitHub provides a three dimensional view or "branches" to a software project. Where simultaneous branches are used for; Development, Experimentation, Patches, HotFixes, and Deployment,  all from within one software project environment. When complete, branches can be merged to update the project, history is maintained for project completeness.

The "GitHub" is the network accessible repository, where others can access your published project.

The "Git"  is the local environment on your computer, where the actual work is typically done. There are command-line and GUI window operations to control the local software development, and which all work with most program development/editor tools.

When necessary, local Git Tools provide means to transfer status and data to-or-from the networked "GitHub". Internally and during transfers, Git and GitHub protects the data from corruption and miss handling with sophisticated cryptographic methods. The use of cryptographic methods is NOT for obscuration nor security, but is simply used to maintain data integrity. What goes into the network or local repository, will come out exactly as it went in.

Each view of a project is call a "branch", Git provides (almost) simultaneous views of a software project. For the developer, a simple command switches between branches.

Typical Local Developer commands are as follows, my linux command-line alases are shown within parentheses, "()":
  • List the current branches = (gbr), git branch 
  • Switch branches = (gco ...), git checkout <branch name>
  • Create a new branch (clone of current) = (gco -b ...), git checkout -b <a new branch name>
  • Save current branch edits = (gci ...), git commit -a -m "A quick note that is saved in history"
  • Merge another branch with the current = (gmg ...), git merge <other branch name>
  • Get current status = (gst), git status 
  • Upload to the GitHub = (gpu ...), git push --all
  • To get Help = git --help

There are other commands that do more sophisticated things, but the basics as listed above will do most things for a new user.

Branches can be named anything, but typical branch names are: "Release", "Dev" (development), "HotFix", "Exp" (experimental). These are then divided into yet other branches to support actual development effort.

For example; When HotFix1234 is finished, it would be merged into HotFix, which could be merged into Dev, and which would ultimatly be merged into Release at the appropriate time. Note: Multiple HotFixNN's could be worked on at the same time, if they effect different sections of code, they will merge without conflicts, otherwise the conflicts will need to be resolved during the merge process. Tools are available to assist with conflict resolution.

My GitHub repository is https://github.com/wa0uwh, over time more software projects will be included.

My current Git software project is "Minima - Alternate Tuning Method" (see previous posts).


Yes,  . . . I am a Git and GitHub Junkie,  . . . and with help,   I am finally willing to admit it !!

--

1 comment: