git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Proposal for git stash : add --staged option
@ 2015-04-22  8:30 edgar.hipp
  2015-04-22  9:25 ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: edgar.hipp @ 2015-04-22  8:30 UTC (permalink / raw)
  To: git

Hello,

There's some feature of git that I have been missing.
When you have a lot of unstaged files, and would like to test what 
happens if you undo some of the changes that you think are unecessary, 
you would rather keep a copy of those changes somewhere.

For example

Changed but not updated:
     M config_test.xml
     M config_real.xml

I have changed both config_test.xml and config_real.xml, but I think the 
changes made in config_test.xml are unnecessary. However, I would still 
like to keep them somewhere in case it breaks something.

In this case for example, I would like to be able to stash only the file 
config_test.xml

Eg:

git add config_test.xml
git stash --staged

So that after this, my git looks like this:

Changed but not updated:
     M config_real.xml

and my stash contains only the changes introduced in config_test.xml

`git stash --keep-index` doesn't give the necessary control, because it 
will still stash everything (and create unnecessary merge complications 
if I change the files and apply the stash)

Best,

Edgar

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-03 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22  8:30 Proposal for git stash : add --staged option edgar.hipp
2015-04-22  9:25 ` Johannes Schindelin
2015-04-23  6:59   ` edgar.hipp
2015-06-03 13:32   ` edgar.hipp

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).