From bdedf51a72156d925b1814776e272572a9c8e581 Mon Sep 17 00:00:00 2001 From: Avjinder Singh Sekhon Date: Mon, 1 Jun 2015 23:46:04 +0530 Subject: Added 'Stages of Git', link to Pro Git, and other forms of git help --- git.html.markdown | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'git.html.markdown') diff --git a/git.html.markdown b/git.html.markdown index af65afb0..dd93dd88 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -79,6 +79,11 @@ this pointer will automatically update and point to the latest commit. HEAD is a pointer that points to the current branch. A repository only has 1 *active* HEAD. head is a pointer that points to any commit. A repository can have any number of heads. +###Stages of Git +* Committed - Files have been committed to the Git Database +* Modified - Changes have been made to a file but file has not been committed to Git Database yet +* Staged - Marks a modified file to go into your next commit snapshot + ### Conceptual Resources * [Git For Computer Scientists](http://eagain.net/articles/git-for-computer-scientists/) @@ -131,6 +136,10 @@ $ git help -a $ git help add $ git help commit $ git help init +# or git --help +$ git add --help +$ git commit --help +$ git init --help ``` ### status @@ -149,8 +158,8 @@ $ git help status ### add -To add files to the current working tree/directory/repo. If you do not `git add` new files to the -working tree/directory, they will not be included in commits! +To add files to the staging area/index. If you do not `git add` new files to the +staging area/index, they will not be included in commits! ```bash # add a file in your current working directory @@ -163,6 +172,8 @@ $ git add /path/to/file/HelloWorld.c $ git add ./*.java ``` +This only addds a file to the staging area/index, it doesn't commit it to the working directory/repo. + ### branch Manage your branches. You can view, edit, create, delete branches using this command. @@ -462,3 +473,5 @@ $ git rm /pather/to/the/file/HelloWorld.c * [GitGuys](http://www.gitguys.com/) * [Git - the simple guide](http://rogerdudler.github.io/git-guide/index.html) + +* [Pro Git](http://www.git-scm.com/book/en/v2) -- cgit v1.2.3 From 470da394f6641dd0a56f48da5bb5f451ea0cbcdc Mon Sep 17 00:00:00 2001 From: Avjinder Singh Sekhon Date: Mon, 1 Jun 2015 23:49:05 +0530 Subject: Fixed some typos --- git.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git.html.markdown') diff --git a/git.html.markdown b/git.html.markdown index dd93dd88..1b83e3a3 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -172,7 +172,7 @@ $ git add /path/to/file/HelloWorld.c $ git add ./*.java ``` -This only addds a file to the staging area/index, it doesn't commit it to the working directory/repo. +This only adds a file to the staging area/index, it doesn't commit it to the working directory/repo. ### branch -- cgit v1.2.3 From 628a4ccfc2d55de69a55622c9cd8a0d9d7819013 Mon Sep 17 00:00:00 2001 From: Avjinder Singh Sekhon Date: Wed, 3 Jun 2015 03:02:38 +0530 Subject: Changed the order of the Stages of Git --- git.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git.html.markdown') diff --git a/git.html.markdown b/git.html.markdown index 1b83e3a3..4bbc58e7 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -80,9 +80,9 @@ HEAD is a pointer that points to the current branch. A repository only has 1 *ac head is a pointer that points to any commit. A repository can have any number of heads. ###Stages of Git -* Committed - Files have been committed to the Git Database * Modified - Changes have been made to a file but file has not been committed to Git Database yet * Staged - Marks a modified file to go into your next commit snapshot +* Committed - Files have been committed to the Git Database ### Conceptual Resources -- cgit v1.2.3