Re: 'git stash push' isn't atomic when Ctrl-C is pressed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yuri <yuri@xxxxxxxxx> writes:

> Ctrl-C was pressed in the middle. git creates the stash record and
> didn't update the files.

If you kill a program in the middle, bad things can happen ;-)

In this case, however, recovery is very easy.

Because you know that a stash entry was created that records the
local changes, if you want to finish "git stash push" (in other
words, if you wish you didn't kill "git stash push" in the middle),
you can "git reset --hard" yourself, because by definition, after
"git stash push" records all the local changes, it would have
cleared any and all local changes.  Or if you truly regret you
started "git stash push" in the first place, then you can still "git
reset --hard" and then "git stash pop".  The first step will let the
"git stash push" to "finish", and then popping the local changes
recorded in there will restore the state before you started running
"git stash push".




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux