revision control

warning: Creating default object from empty value in /home1/kienetzc/public_html/modules/taxonomy/taxonomy.pages.inc on line 34.

How to Git - Common commands

So, you've been commiting stuff and doing simple things. Now it's time to get to know simple commands that might help you quite a lot.

Show your local branches: git branch
Show local and remote branches: git branch -a
Listing files changed in each commit: git log --name-only
Note that by using the above command you'd be able to find in which commits you changed a given file, then you could see the changes of that commit by using: git show commit_id_hash

How to Git - Commiting changes

After you have added files to your repository and/or changed old files, you get to a point where you want to make sure the actual state is saved, so that you can go back to that state in the future if you need - that is called commit. That's one of the reasons for using Git.
In order to do that, you run: git status
Which shows the modified files and/or new ones.

You choose which files you want to commit by running: git add filename.ext
You might as well add whole directories: git add directory/

How to Git - Creating a brand new repository

I started using Git in the beginning of 2008, when I started working for Versabanq (London, ON, Canada). I had almost no idea how to use it, just the really basic stuff from Subversion (and I used to use a GUI for svn - subclipse).
So, for those like me, here goes the basic part on how to start with it.

First we must set our global preferences.

git config --global user.name "Your Full Name"
git config --global user.email "whateveryouremailaddressis@domain.com"

If you plan to use Git on Windows, you should probably set these too:

Syndicate content