Ok, after seeing this post by PJ Hyett, I have decided to skip to the end and go with Git.
So what I need is a beginner's practical guide to Git. "Beginner" being defined as someone who knows how to handle their compiler, understands to some level what a Makefile is, and has touched source control without understanding it very well.
"Practical" being defined as this person doesn't want to get into great detail regarding what Git is doing in the background, and doesn't even care (or know) that it's distributed. Your answers might hint at the possibilities, but try to aim for the beginner that wants to keep a 'main' repository on a 'server' which is backed up and secure, and treat their local repository as merely a 'client' resource.
So:
Installation/Setup
- How to install Git
- How do you set up Git? Try to cover Linux, Windows, Mac, think 'client/server' mindset.
- How do you create a new project/repository?
- How do you configure it to ignore files (.obj, .user, etc) that are not really part of the codebase?
Working with the code
- How do you get the latest code?
- How do you check out code?
- How do you commit changes?
- How do you see what's uncommitted, or the status of your current codebase?
- How do you destroy unwanted commits?
- How do you compare two revisions of a file, or your current file and a previous revision?
- How do you see the history of revisions to a file?
- How do you handle binary files (visio docs, for instance, or compiler environments)?
- How do you merge files changed at the "same time"?
- How do you undo (revert or reset) a commit?
Tagging, branching, releases, baselines
- How do you 'mark' 'tag' or 'release' a particular set of revisions for a particular set of files so you can always pull that one later?
- How do you pull a particular 'release'?
- How do you branch?
- How do you merge branches?
- How do you resolve conflicts and complete the merge?
- How do you merge parts of one branch into another branch?
- What is rebasing?
- How do I track remote branches?
- How can I create a branch on a remote repository?
- How do I delete a branch on a remote repository?
- Git workflow examples
Other
- Describe and link to a good GUI, IDE plugin, etc. that makes Git a non-command line resource, but please list its limitations as well as its good.
- msysgit - Cross platform, included with Git
- gitk - Cross platform history viewer, included with Git
- gitnub - Mac OS X
- gitx - Mac OS X history viewer
- smartgit - Cross platform, commercial, beta
- tig - console GUI for Linux
- qgit - GUI for Windows, Linux
- Git Extensions - package for Windows, includes friendly GUI
- Any other common tasks a beginner should know?
- How do I work effectively with a subversion repository set as my source control source?
Other Git beginner's references
- Git guide
- Git book
- Git magic
- gitcasts
- GitHub guides
- Git tutorial
- Progit - book by Scott Chacon
- Git - SVN Crash Course
- Git from the bottom up
- Git ready
- gitref.org
- Git visual cheatsheet
Delving into Git
I will go through the entries from time to time and 'tidy' them up so they have a consistent look/feel and it's easy to scan the list - feel free to follow a simple "header - brief explanation - list of instructions - gotchas and extra info" template. I'll also link to the entries from the bullet list above so it's easy to find them later.
I got started with the official Git tutorial. I think it's practical enough for beginners (I was, and still am, a beginner, by your definition! I barely grasp makefiles, I've only played a bit with Apache Subversion, etc.).
Console UI - Tig
Installation:
Usage
While inside a git repo, type 'tig', to view an interactive log, hit 'enter' on any log to see more information about it. h for help, which lists the basic functionality.
Trivia
"Tig" is "Git" backwards.
Getting the latest Code
That pretty much covers every case for getting the latest copy of the code from the remote repository.
Well, despite the fact that you asked that we not "simply" link to other resources, it's pretty foolish when there already exists a community grown (and growing) resource that's really quite good: the Git Community Book. Seriously, this 20+ questions in a question is going to be anything but concise and consistent. The Git Community Book is available as both HTML and PDF and answers many of your questions with clear, well formatted and peer reviewed answers and in a format that allows you to jump straight to your problem at hand.
Alas, if my post really upsets you then I'll delete it. Just say so.
Here's a copy of PJ Hyett's post, as it is not available anymore:
How do you compare two revisions of a file, or your current file and a previous revision?
Compare command is
git diff
.To compare 2 revisions of a file:
That diffs commit1 against commit2; if you change order then files are diffed the other way round, which may not be what you expect...
To compare current staged file against the repository:
To compare current unstaged file against the repository: