Saturday, April 18, 2009

I think I got git

I've played around with git for a bit. Instead of using /etc, I used a directory in my user account that had a mixed collection of binary and text files.

First, I setup the git environment:
$ git config --global user.name "Rahi Parsi"
$ git config --global user.email rparsi@learn.senecac.on.ca
Then using the mockresults directory:
$ git init
$ git commit

This is where I first got a little confused. Git displays a text document using vi (or "less", not really sure). I couldn't figure out what to do at first. After some frustration, figured out that I can enter some remarks and just save.

Next I created some text files, created some zip files using the rpm's, and added to git:
$ git add stuff.zip notes.txt
$ git commit

Created a test branch:
$ git branch test
$ git checkout test

Made some changes:
$ rm root.log state.log
$ git commit -a
$ git checkout master

I made more changes by creating directories and adding files. The "vi" like popup screen that shows up after "$ git commit" takes some getting used to. It just feels odd, as I've never used a RCS that behaved like that.

Cleanup:
$ git branch -d experimental

Overall, I like git. It's not that hard to figure out and is quite versatile. Only negative I can say about it, is the "vi" popups for comments. Maybe I'm asking for too much, but I think there's a better approach somewhere.

1 comment:

  1. You can set git to prompt you for the commit message in any editor you want.

    git config core.editor /usr/bin/editor
    git commit -a

    You can also just pass the commit message with the -m flag:

    git commit -m"this is my message" -a

    ReplyDelete