Hi,

Sometimes, I messed-up with git repository and lost works due
carelessness. This includes reset a branch instead of other, drop the
stash etc by mistake. I wonder, is there way to a get an interactive
confirmation prompt (which ask for yes/no option) before executing those
commands when users can possibly lose their work? Like, some UNIX
commands have support for an interactive prompt (like 'rm -i', 'mv -i',
'cp -i', etc) for ex: before deleting and overwriting a file a
confirmation is prompt and asking for users permission.
        If there would no such feature available in git, so how do other people
avoid these kind of mistakes? Obviously, one them would be recheck the
command carefully before executing it and repo status but, I think
sometimes people also do these kind of mistakes. For now, to minimize
some of these kind problems I've modified my bash shell prompt to show
all kind information related to a git repository by sourcing
"git-prompt" script (provided with git package) and turn on all of flags
provided by it which significantly increase my productivity and less
mistakes than earlier. But, anything else I can do to avoid these kind
of mistakes at first place or increase my productivity (it includes
adopting some best practices, using some command line tools etc).
        I searched it on the Internet and found that there are many GUI tools
available which help with these problems but don't want to use GUI tools
because most of time I work in command line environment and love using
command line tool than GUI one.

Any help would be greatly appreciated. Thanks.

PS: Sometimes, I would recover my work by seeking some help mostly on
#git IRC but, it would be better avoid this kind of mess at first place.

Cheers,
Vipul

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to