git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Jacob KellerNext: Jacob Keller
Message 7 of 23 in “[RFC/GSoC] Introduction”
  1. Sidhant SharmaMar 12, 2016
  2. Lars SchneiderMar 13, 2016
  3. Sidhant SharmaMar 13, 2016
  4. Kevin DaudtMar 13, 2016
  5. Sidhant SharmaMar 14, 2016
  6. Jacob KellerMar 14, 2016
  7. Junio C HamanoMar 14, 2016
  8. Jacob KellerMar 13, 2016
  9. Sidhant SharmaMar 14, 2016
  10. Jacob KellerMar 14, 2016
  11. Sidhant SharmaMar 14, 2016
  12. Junio C HamanoMar 14, 2016
  13. Lars SchneiderMar 14, 2016
  14. Sidhant SharmaMar 14, 2016
  15. Matthieu MoyMar 20, 2016
  16. Junio C HamanoMar 14, 2016
  17. Matthieu MoyMar 20, 2016
  18. Philip OakleyMar 14, 2016
  19. Sidhant SharmaMar 17, 2016
  20. Lars SchneiderMar 20, 2016
  21. Sidhant SharmaMar 20, 2016
  22. Lars SchneiderMar 20, 2016
  23. Sidhant SharmaMar 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.