Sunday, July 18, 2010

Git :: Install :: Setup

Install GUI
$ sudo apt-get install git-core gitk git-gui

URL: http://www.digitalmediaminute.com/article/3264/git-tutorial

To create a repository
$ cd testGit
$ git init

This is to setup the configuration to contain ur name and email
This will be used to give information on who committed
$ git config --global user.name "Kashi Revanna"
$ git config --global user.email "Kashi.Revanna@unt.edu"

So now create a file and a directory
$ touch file1
$ mkdir dir
$ git commit

Now to check git, open the file and enter a line
$ git diff
- will list the lines which are different from the ones in the repository

To add a file to the repository
$ touch file2
$ mkdir dir1
$ git add file2
$ git add dir1
$ git commit -m "Add files"

Observe the log files created
$ git log
$ git log -n3
$ git log --stat --summary
$ git log -p

For GUI,
$ gitk

No comments:

Post a Comment