Re: [RFC/GSoC] Introduction
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2016, 07:01 UTC
- Message-ID
- <xmqqfuvt8rws.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160313211910.GA22052@ikke.info>
Kevin Daudt <me@ikke.info> writes:
Show 18 quoted lines
> On Mon, Mar 14, 2016 at 12:03:33AM +0530, Sidhant Sharma wrote: >> >> >> >> Other than this, I also tried to expand the list of potentially destructive >> commands and updated the list as follows (additions in brackets): >> >> * git rebase [ git pull --rebase ] >> * git reset --hard >> * git clean -f >> * git gc --prune=now --aggressive >> * git push -f [ git push <remote> :<branch>, git push <remote> +<branch> ] >> * [ git branch -D ] >> >> Are these additions appropriate? What other commands should be included? > > git checkout [ref] <file> is destructive too if it would overwrite an > uncomitted change.
Obviously. As that was designed to be the way to get rid of unsuccessful/unwanted edit in the working tree.
"git add <file>" is destructive if it overwrites the index entry that holds contents you have not committed.
"git rm [--cached] <file>" is destructive, too.
I think "git checkout [<ref>] <file>" falls into the same category.