To see what's new since version 2.0.0, check out the release notes at <http://git.kernel.org/cgit/git/git.git/tree/Documentation/RelNotes/2.1.0.txt>. Downloads are available from <http://git-scm.com/downloads>.
What is the proper action when you end up in a situation with Git you're not familiar with? This is a set of step-by-step procedures for Git astronauts to help them resolve the issue when things become scary. It's stored as a MarkDown document on GitHub, so if you know how to resolve a situation that's not listed there, create a pull request to help out your fellow astronauts.
You probably have many git commands you repeat several times a day. To save keystrokes, you can create git aliases to convert the commands into short and easy commands. But what are the commands you use the most? If you're using bash, one way to find out is to check the .bash_history file. This file contains a list of all the commands you enter on the command line. To find out which git commands you use the most, execute this command:
grep '^git ' ~/.bash_history | sort | uniq -c | sort -n
This creates a list of all git commands logged in .bash_history with the most used commands at the end of the list. If you're using zsh, replace .bash_history with .zsh_history (default in zsh) or .zhistory if you're using oh-my-zsh.
The aliases are stored in the ~/.gitconfig file, here are some examples:
br = branch
ci = commit
# dw: Create word diff
dw = diff --word-diff
# dww: Create diff showing single characters
dww = diff --word-diff --word-diff-regex=.
# fp: Fetch from all remotes and forget deleted remote branches
fp = fetch --all --prune
# lp: git log with patch
lp = log -p --cc --decorate=short
st = status -bs
# rank: Create a list sorted by most active authors
rank = shortlog -sne
rv = remote -v
# delbr: delete all merged branches
delbr = !git branch -d `git branch --merged | cut -c3DASH`
(In the "delbr" alias, replace DASH with a single hyphen/minus, had to do it this way because Google Plus insisted on using overstrike. Any tips on how to disable G+ formatting in cases like this is very, very welcome.)
Also, if your command is too complicated to be represented by a git alias, you can create a script named git-[command] and store it in a directory in your $PATH. For example, name this script "git-bs" and place it somewhere in your $PATH:
# Wrapper to allow execution of git-bisect in subdirectories
cd "$(git rev-parse --show-toplevel)"
git bisect "$@"
You now have a "git bs" command that works just like "git bisect", but can be executed from any subdirectory in your source tree.
Do you have any favourite aliases or git-* scripts? Please contribute useful examples in the comments!
"Nowadays, you’ll have a hard time finding a professional developer who doesn’t use a version control system (VCS) such as Git.
But, there are still a few among us who choose not to use a VCS due to preconceived notions they might have about version control.
Here are some myths and excuses that dissuade developers from integrating Git — and any version control system in general — into their workflow."
This essay was written in 2008, around two and a half year after Git was created. So why post this now, more than six years later? Because, in hindsight, really hit the nail on the head with this post. Git started out not as a revision control system, but a distributed file system that could be built upon and used for all kinds of interesting things. Have a read and get inspired.
Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
This page is not an official page by the Git project, but created and updated by Øyvind A. Holm.