Why Git? Come to the GitGuys for 30+ FREE Tutorials

Better history, less fear

With a typical version control system, the workflow is:

  1. Check out the project from the central repository
  2. Make modifications
  3. Check in/submit/commit changes back to the central repository.

Depending on the change, step 3 can strike fear into the person doing the change: As soon as the “enter” key is pushed, the changes might introduce a bug into everybody’s code.

As a result, the natural tendency is to submit changes to the central repository as infrequently as possible: Pack in more than one bug fix when pushing code to the central repository. Maybe even toss in a new feature or two with each checkin.

However, with git, you have the ability to commit changes to your own local, private branch as often as you’d like, without modifying the central repository. You can make a separate decision on when you would like to push your local changes to the public repository. The work flow for git has an extra step:

  1. Check out the project from the central repository
  2. Make modifications
  3. Check in/submit/commit changes to the local repository
  4. Check in/submit/commit local changes back to the central repository.

The result:

  • You can and likely will make more commits to your local branch.
  • More commits mean a better history of the changes you’ve made to the repository: You can look back at the commit history and see which lines of code were changed for a particular bug fix, rather than having one big set of changes that fixed 3 different bugs.

Flexibility in where you work

When you checkout a git project, you get the whole repository including all of its history. It contains the same contents as the original contents.
You can do local commits, create new branches, and work as much as you’d like, without needing to be connected to the network or central repository.

When you’re ready to check in to a central repository, connect to a network and push the changes in.

Branching is easy

Branching on some legacy version control systems is left to experts and VCS administrators. Not so with git: Think up a new feature? Create a branch and start working on it immediately. Jump between branches. Merge branches back into the
main branch.

Stash the current changes, do work on another branch, check in the changes in the other branch, then continue back where you did the “git stash” (yes, there really is a “git stash” command).

Flexible and Powerful

Git gives you all you need for basic revision control, of course. But it also gives you the tools needed for advanced revision control.

Git was designed and written by the creator of Linux, which has a similar elegant, simple, yet very flexible and powerful design. Many commands can be integrated together and used as needed even more powerful than single commands by themselves.

Git is like Linux: It not only lets you see how it works, but gives you ability to creatively use the git tools to create something bigger or customised for your requirements.

Git is Fast

Everything about git is fast. It doesn’t slow you down, and doesn’t get in the way.

Recent Articles

What is the deal with the Git Index? What is the Git Index?

The git "index" is where you place files you want committed to the git repository. Learn more about the git index and git commit by selecting this link.

Visualising Branches And Their Commits | Git Show-branch

We explain and discuss the use of the git show-branch, gitg, gitk and qgit in this Tutorial. Complete with examples.

“Tracking Branches” And “Remote-Tracking Branches”

Both Tracking Branches and Remote Tracking Branches are created on the git client when a git clone command is used.

Temporarily Stashing Your Work

Git Stash is used when you want to record the current state of the working directory and index, without committing, to come back to complete later.

Shared Repositories Should Be Bare Repositories

Bare Repositories - When creating a central repository that will be shared by other users, the repositories should be created with the --bare option.

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox