git reset --soft HEAD~ modifies staged snapshot? -


from whatever have read git reset --soft, learned doesn't modified staging area or index. in below example can see staging area/index modified result of git reset --soft. why?

mkdir test;cd test;git init; touch a; echo 1 >>a;git add a;git commit -m"1" a; echo 2 >>a;git commit -m"2" a;  git diff --cached; <no output> git reset --soft head~; git diff --cached;<see below output>  --- a/a +++ b/a @@ -1 +1,2 @@  1 +2 

a commit of particular content. index indexes particular content. git diff --cached compares indexed content against named commit. when reset head, changed commit git diff --cached compares against.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -