git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pressing Ctrl-C during 'git checkout <branch-name>' messes up the repository
@ 2023-07-15  4:26 Yuri
  2023-07-16  0:24 ` brian m. carlson
  0 siblings, 1 reply; 6+ messages in thread
From: Yuri @ 2023-07-15  4:26 UTC (permalink / raw)
  To: Git Mailing List

It stops in some intermediate state, and git still says that it is on 
the main branch, but 'git checkout' deletes files that were added only 
in the main branch,

'git reset --hard HEAD' fixes the main branch, bit now it is impossible 
to switch to the other branch because it says that "some files would be 
overwritten", which shouldn't be the case.


All operations should be atomic.

When the user presses Ctrl-C, the correct action would be to cleanly 
return to the initial branch.


git-2.41.0


Thanks,

Yuri



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

end of thread, other threads:[~2023-07-17 16:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-15  4:26 Pressing Ctrl-C during 'git checkout <branch-name>' messes up the repository Yuri
2023-07-16  0:24 ` brian m. carlson
2023-07-16  1:15   ` Junio C Hamano
2023-07-17  0:16   ` Yuri
2023-07-17  9:18   ` Konstantin Khomoutov
2023-07-17 16:35     ` Andreas Schwab

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