Note that there are some explanatory texts on larger screens.

plurals
  1. POgit commit commits unstaged hunks
    primarykey
    data
    text
    <p>I used <code>git add -p</code> to split my code changes into multiple commits. However, doing <code>git commit</code> after that commits <em>all</em> changes, including the unstaged ones. I looked at a few questions on SO, but could not find any obvious mistake. Could you please help me understand what I am doing wrong? Below are the commands I tried, and their outputs. </p> <pre><code>bash-3.2$ git diff test11.txt diff --git a/test11.txt b/test11.txt index f077274..e811cae 100644 --- a/test11.txt +++ b/test11.txt @@ -1,5 +1,5 @@ -Hello -World +hello +world -Blahblahblah -blah +blahblahblah +Blah bash-3.2$ git add -p test11.txt diff --git a/test11.txt b/test11.txt index f077274..e811cae 100644 --- a/test11.txt +++ b/test11.txt @@ -1,5 +1,5 @@ -Hello -World +hello +world -Blahblahblah -blah +blahblahblah +Blah Stage this hunk [y,n,q,a,d,/,s,e,?]? s Split into 2 hunks. @@ -1,3 +1,3 @@ -Hello -World +hello +world Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y @@ -3,3 +3,3 @@ -Blahblahblah -blah +blahblahblah +Blah Stage this hunk [y,n,q,a,d,/,K,g,e,?]? n bash-3.2$ git status # On branch test # Changes to be committed: # (use "git reset HEAD &lt;file&gt;..." to unstage) # # modified: test11.txt # # Changes not staged for commit: # (use "git add &lt;file&gt;..." to update what will be committed) # (use "git checkout -- &lt;file&gt;..." to discard changes in working directory) # # modified: test11.txt bash-3.2$ git commit test11.txt [test 1b85189] Test12 1 files changed, 4 insertions(+), 4 deletions(-) bash-3.2$ git status # On branch test nothing added to commit </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload