From: "Khurshid, Beenish" <Beenish.Khurshid@thisisant.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: git commits unstaged files
Date: Thu, 17 Jan 2019 20:57:59 +0000 [thread overview]
Message-ID: <19f764a20b384e099372921d76ec4f73@thisisant.com> (raw)
Hi,
I frequently use 'git add -p' to filter changes before committing. This usually works, but on many occasions, the use of add and commit results in unstaged chunks and files being committed.
Steps to reproduce:
1. Create unstaged changes
2. Use add -p to add some of those changes
3. Use git commit to commit the staged changes
Expectation: Only added chunks are committed.
Result:
1. When editing the commit message, the added files appear staged in the comments at the end of the commit message, and the unstage files appear unstaged. (expected behaviour)
2. All unstaged changes and files are committed.
3. Once git enters this state, even git add produces the same result: Using git add to only add some files (and not chunks), and subsequently committing, results in unstaged files also being committed.
4. Even after restarting git bash, the behaviour persists.
5. The same behaviour occurs when adding and committing a file, while leaving other files unstaged, when using Git GUI instead of Git Bash
Environment:
Git version 2.12.2.windows.2
Windows 10 enterprise
Hooks: commit-msg, and pre-commit
Changes were being committed, reset, and rebased prior to this add -p attempt
If more information is needed, please do not hesitate to contact me. Since this is a significant part of my workflow, the failure of the command to work in the expected way is fairly disruptive to my workflow.
Any help or thoughts would be appreciated!
Kind Regards,
Beenish Khurshid, E.I.T I Applications Engineer
ANT Wireless | 124 - 30 Bow Street Common, Cochrane, AB, Canada T4C 2N1
P: 587.493.4156 | F: 403.932.6521
next reply other threads:[~2019-01-17 20:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-17 20:57 Khurshid, Beenish [this message]
2019-01-18 10:32 ` git commits unstaged files Johannes Schindelin
2019-01-18 19:03 ` Khurshid, Beenish
2019-01-21 14:52 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19f764a20b384e099372921d76ec4f73@thisisant.com \
--to=beenish.khurshid@thisisant.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).