Git Command explained with snapshots (II)

10 Dec

Continuing the previous article, now let’s apply some modifications on the “SomeText.txt”, but do NOT save it at the moment! Then run the command “git diff”



Save the document, and run “git diff” again! Now one can see Git has detected the difference!


Now commit the changes to Git using  git commit SomeText.txt –m “Second commit” and fire thegit log command:


Go on a third change and commit it to Git. Now there 3 version of SomeText.txt !  To show the latest 10 revisions:


Now one can clone this existing repository with ease:
First go to the parent folder using “cd .. “ then the “git clone …” is used.

image   image

To commit all changes, use below commands:

git commit . –m “Some Message”

To rename a file and then commit the changes:

git mv source.file target.file
git commit –m “I have renamed the source to target”

Previous article on Git | Next article on Git

1 Comment

Posted by on December 10, 2011 in General


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

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: