I’ve been aware of different version control systems since I started using Linux. Why? Often times I am asked to install the latest development version of a software as the last tarball (*.tar.gz) has not been updated for a while. I’ve pulled code most often using Subversion (SVN), Git, and CVS. Of the various version control systems, I must say Subversion is the most prevalent out there. However, I’ve heard many preach about Git, similar to people preaching about Emacs (me being one of them). Even though Git is not as “standard” as Subversion, I chose Git because
- many acquaintances I think highly of use Git,
- many tutorials out there (although this is true for most popular systems),
- Linux kernel is managed using Git, and
- existence of
git-svn, so I can still use SVN through Git.
I will write more about my experience with Git on particular projects later (e.g., Git with SVN on R-Forge). For this post, I’ll just post some references I’ve used to learn Git and the common commands I use (reminder to self).
First, read this short tutorial to understand Git. Like the author described, most tutorials show you command. The author tries to explain the concept of version control and their principles in Git.
Try out Git on one of your projects (create a folder and create and edit some files).
Next, read the Git Magic book (online). It gives a good analogy of version control to video games, along with
To undo what you’ve edited since the last commit, remember
git reset --hard HEAD.
Once I get the command lines down well to know exactly what’s going on, I plan to incorporate magit, an emacs extension for git, into my workflow.
Now, my notes to remember:
<pre class="src src-sh"><span style="color: #ff4500;">## </span><span style="color: #ff4500;">start version control in a project/folder</span>
git init git add … ## files, folders, etc. git commit -a -m “COMMENTS” ## commit