What is GitHub?
On the Petri IT Knowledgebase, I contributed a piece called What is JSON and How Is It Used? Following on from that in today’s Ask the Admin, I’d like to talk about another developer tool that system administrators may already have encountered, because it’s becoming more common for GitHub to be used for storing code and scripts associated with Microsoft products, such as Azure, Windows Server, and PowerShell.
Let’s start with Git, which is an open-source versioning system for code. While Git is technically a separate entity from the Hub, i.e. it can be used without the Hub, you can think of Git’s functionality a little like the versioning control for documents in SharePoint.
Developers add fresh code to a project or download existing code from GitHub, make changes, and commit code to a local database maintained by Git. Snapshots make Git more efficient than other version control systems, and instead of making copies of files that haven’t changed since the last commit operation, links are provided to unchanged files.
Other advantages include built-in integrity checking so that file corruption never poses a problem and the ability to experiment freely with code because once committed, files are hard to lose or remove. Project files in Git can have one of three states: committed, modified, or staged. Committed files are written permanently to the local database, while modified files have changed but yet to be committed. Finally, staged files are unchanged but marked to be committed in the next snapshot.
GitHub provides a place to store repos in the cloud. Public repos are free, and private repos start from $7 a month. If you don’t want to develop in the cloud, GitHub Enterprise offers a solution that you can run on your own servers.
Even if you are not a programmer and if you have followed the development of Windows 10, you’re probably familiar with the concept of ‘forking’, where a clone of an existing project is made and development continues. So for example, you can ‘fork’ a project on GitHub and add your own code to create a unique project. And there’s also the ability to merge updates made to the original repo to the forked project.
Forking, Pull Requests, and Code Branches
If you want your new code to be included in the original project repository, you can create a pull request so that the original developers can see your repo and decide whether to accept your request. Git allows developers to create new branches when a new feature or bug fix is added to code, keeping the original fork or ‘master branch’ untouched.
Git uses the checkout parameter to create and switch to a new branch on the local machine, and then the branch can be pushed to GitHub. Pull requests can be performed on individual branches once they’re ready for consumption.
GitHub vs. Visual Studio Online
Social networking features and changelogs make it easy for groups to work on coding projects using GitHub, along with the versioning control that Git provides. So if you need to develop a script or application, you might consider using GitHub to simplify the collaboration effort.
GitHub isn’t the only solution however for collaborative coding projects. Microsoft Visual Studio Online offers a similar solution, with the option to use Git for distributed version control or Microsoft’s own Team Foundation version control (TFVC) for a centralized option. Additionally it includes other features to enable continuous development, where apps are automatically deployed if they pass a series of tests, support for the Scrum team collaboration framework, Kanban workflow visualization boards, and a host of other project management features.