Git Command explained with snapshots (I)

10 Dec

The very beginning step is probably creating/selecting a folder (e.g. C:\_Test) where to keep your source code. Now this folder is just a common folder, and it is not a Git repository yet. To let Git know this, use the command: “git init


The folder before “git init”

After running the command, a hidden directory “.git” will be created, as shown below. Git use this to distinguish a common folder with a repository or working directory.

    image image
The folder after“git init” is executed (hidden files)

Now add a new file, e.g. SomeText.txt to this folder







Then type the below command: “git status


As is seen that although a file is added to the folder, but Git is ignorant of this yet!

To inform Git that it should keep an eye (or track) this file, use below commands

git add SomeText.txt
git status


Now Git gets informed that this file is added!  Or more specifically, the file is Staged (but not actually added to the repository yet!)

Let ‘s try again to remove this file from Git repository: the highlighted words are typed-in commands


This terminates the link of “SomeText.txt” in the folder with Git now.

All right, let’s finally add it to Git!



Previous article on Git   |  Next article on Git

1 Comment

Posted by on December 10, 2011 in Programming


One response to “Git Command explained with snapshots (I)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: