A beginners guide to Git
GIT is a version control system that keeps track of every modification to the code. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members. GIT is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds.
Feature Branch Workflow
Unlike centralized version control systems, GIT branches are cheap and easy to merge. This facilitates the feature branch workflow popular with many GIT users.
Feature branches provide an isolated environment for every change to your codebase. When a developer wants to start working on something — no matter how big or small — they create a new branch. This ensures that the master branch always contains production-quality code.
As GIT is a distributed version control system, it can be used as a server out of the box. Dedicated GIT server software helps, amongst other features, to add access control, display the contents of a GIT repository via the web, and help managing multiple repositories.
GitHub is a GIT repository hosting service, which offers all of the distributed revision control and source code management functionality of GIT. Unlike GIT, GitHub provides a graphical interface. It also provides access control and several collaboration features such as wikis, task management, and bug tracking and feature that can be helpful for projects. It allows you to collaborate with other people on a project. It does that by providing a centralized location to share the repository, a web-based interface to view it, and features like forking, pull requests distributed revision control, issues, and wikis.
GitHub is where people build software. More than 14 million people use GitHub to discover, fork, and contribute to over…github.com
Bitbucket is a web-based hosting service for projects that use either the GIT or the Mercurial revision control systems. Bitbucket offers both commercial plans and free accounts.
Bitbucket is the Git solution for professional teams. Collaborate on code with inline comments and pull requests…bitbucket.org
GitLab provides a software repository service. It offers a web interface like GitHub, and is written in Ruby.
Listed below are some GIT clients. You can use these if you prefer not to use the command line.
GitX-dev is a fork (variant) of GitX, a long-defunct GUI for the git version-control system. It has been maintained and…rowanj.github.io
SourceTree is a free Mercurial and Git Client for Windows and Mac that provides a graphical interface for your Hg and…www.sourcetreeapp.com
GitEye is pre-integrated with CloudForge™, TeamForge® and GitHub, and works on most platforms.www.collab.net
Git Extensions : Git Extensions is the only graphical user interface for Git that allows you control Git without using…gitextensions.github.io
The entire Pro Git book written by Scott Chacon and Ben Straub is available to read online for free. Dead tree versions…git-scm.com
The “blame” feature in GIT describes the last modification to each line of a file, which generally displays the revision, author and time. This is helpful, for example, in tracking down when a feature was added, or which commit led to a particular bug.
A branch is a parallel version of a repository. It is contained within the repository, but does not affect the primary or master branch allowing you to work freely without disrupting the “live” version. When you’ve made the changes you want to make, you can merge your branch back into the master branch to publish your changes.
A clone is a copy of a repository that lives on your computer instead of on a website’s server somewhere, or the act of making that copy. With your clone you can edit the files in your preferred editor and use GIT to keep track of your changes without having to be online. It is, however, connected to the remote version so that changes can be synced between the two. You can push your local changes to the remote to keep them synced when you’re online.
A collaborator is a person with read and write access to a repository who has been invited to contribute by the repository owner.
A commit, or “revision”, is an individual change to a file (or set of files). It’s like when you save a file, except with GIT, every time you save it creates a unique ID (a.k.a. the “SHA” or “hash”) that allows you to keep record of what changes were made when and by who. Commits usually contain a commit message which is a brief description of what changes were made.
A contributor is someone who has contributed to a project by having a pull request merged but does not have collaborator access.
A diff is the difference in changes between two commits, or saved changes. The diff will visually describe what was added or removed from a file since its last commit.
Fetching refers to getting the latest changes from an online repository (like GitHub.com) without merging them in. Once these changes are fetched you can compare them to your local branches (the code residing on your local machine).
A fork is a personal copy of another user’s repository that lives on your account. Forks allow you to freely make changes to a project without affecting the original. Forks remain attached to the original, allowing you to submit a pull request to the original’s author to update with your changes. You can also keep your fork up to date by pulling in updates from the original.
GIT is an open source program for tracking changes in text files. It was written by the author of the Linux operating system, and is the core technology that GitHub, the social and user interface, is built on top of.
Issues are suggested improvements, tasks or questions related to the repository. Issues can be created by anyone (for public repositories), and are moderated by repository collaborators. Each issue contains its own discussion forum, can be labeled and assigned to a user.
Markdown is an incredibly simple semantic file format, not too dissimilar from .doc, .rtf and .txt. Markdown makes it easy for even those without a web-publishing background to write prose (including with links, lists, bullets, etc.) and have it displayed like a website. GitHub supports Markdown, and you can learn about the semantics here.
Merging takes the changes from one branch (in the same repository or from a fork), and applies them into another. This often happens as a Pull Request (which can be thought of as a request to merge), or via the command line. A merge can be done automatically via a Pull Request via the GitHub.com web interface if there are no conflicting changes, or can always be done via the command line. See Merging a pull request.
Open source software is software that can be freely used, modified, and shared (in both modified and unmodified form) by anyone. Today the concept of “open source” is often extended beyond software, to represent a philosophy of collaboration in which working materials are made available online for anyone to fork, modify, discuss, and contribute to.
Organizations are a group of two or more users that typically mirror real-world organizations. They are administered by users and can contain both repositories and teams.
Private repositories are repositories that can only be viewed or contributed to by their creator and collaborators the creator specified.
Pull refers to when you are fetching in changes and merging them. For instance, if someone has edited the remote file you’re both working on, you’ll want to pull in those changes to your local copy so that it’s up to date.
Pull requests are proposed changes to a repository submitted by a user and accepted or rejected by a repository’s collaborators. Like issues, pull requests each have their own discussion forum. See Using Pull Requests.
Pushing refers to sending your committed changes to a remote repository such as GitHub.com. For instance, if you change something locally, you’d want to then push those changes so that others may access them.
This is the version of something that is hosted on a server, most likely GitHub.com. It can be connected to local clones so that changes can be synced.
A repository is the most basic element of GitHub. They’re easiest to imagine as a project’s folder. A repository contains all of the project files (including documentation), and stores each file’s revision history. Repositories can have multiple collaborators and can be either public or private.
SSH keys are a way to identify yourself to an online server, using an encrypted message. It’s as if your computer has its own unique password to another service. GitHub uses SSH keys to securely transfer information from GitHub.com to your computer.
When talking about a branch or a fork, the primary branch on the original repository is often referred to as the “upstream”, since that is the main place that other changes will come in from. The branch/fork you are working on is then called the “downstream”.
Users are personal GitHub accounts. Each user has a personal profile, and can own multiple repositories, public or private. They can create or be invited to join organizations or collaborate on another user’s repository.