Hi,
This issue is in regards to the git clear command.
I was showing git extras to some people today using the git repl. I typed clear to clear the text in the repl. It asked me if I was Sure. I thought it was asking me if I was sure that I wanted to clear my screen. I didn't think for more than a few seconds about it and I typed "y" for yes. It didn't clear my screen. What it actually did was hard delete 4 files worth of code that existed only in that directory with no other copies.
I do realise that this is my mistake and that I was in a rush, so I didn't pay enough attention.
However, I still want to urge @tj and team to add some more loud safeguards to git clear so that users understand that the action they are about to take is absolutely irreversible and will delete un-tracked code. I would suggest doing this by:
- Printing the line
Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]: in CAPITAL and red color letters.
- Asking the user a second time just to make sure. And printing the list of files that are about to be affected by this command.
Thank you. I sincerely hope you act on this.
Hi,
This issue is in regards to the
git clearcommand.I was showing
git extrasto some people today using thegit repl. I typedclearto clear the text in the repl. It asked me if I was Sure. I thought it was asking me if I was sure that I wanted to clear my screen. I didn't think for more than a few seconds about it and I typed "y" for yes. It didn't clear my screen. What it actually did was hard delete 4 files worth of code that existed only in that directory with no other copies.I do realise that this is my mistake and that I was in a rush, so I didn't pay enough attention.
However, I still want to urge @tj and team to add some more loud safeguards to
git clearso that users understand that the action they are about to take is absolutely irreversible and will delete un-tracked code. I would suggest doing this by:Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]:in CAPITAL and red color letters.Thank you. I sincerely hope you act on this.