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

Re: Feedback on git-restore

From
Duy Nguyen <pclouds@gmail.com>
Date
May 15, 2019, 11:16 UTC
Message-ID
<20190515111647.GA31209@ash>
In-Reply-To
<87d0kkvv96.fsf@evledraar.gmail.com>
On Wed, May 15, 2019 at 12:59:17PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
> One thing that would be really useful (and maybe it even exists, I just
> haven't seen it in the mails) is some abbreviated cheatsheet style doc
> of before/after in the UI. Similar to cheatsheets like e.g.:
> 
>     https://git.wiki.kernel.org/images-git/7/78/Git-svn-cheatsheet.pdf
>     http://unix4admins.blogspot.com/2013/03/unix-commands-comparison-sheet.html
> 
> As far as I can tell the best examples are your changes to
> s/checkout/[reset|switch]/ in various existing docs, that's great, but
> isn't so easy to understand at a glance.

OK the cheatsheet would be like this (I'm dropping "git" prefix to keep it short)

checkout <branch> -> switch <branch> (same "dwim" behavior) checkout <revision> -> switch --detach <revision> checkout -b <branch> <rev> -> switch -c <branch> <rev> checkout <path> -> restore [--worktree] <path> checkout <rev> -- <path> -> restore --source=<rev> --worktree --staged <path> reset <path> -> restore --staged <path> reset <rev> -- <path> -> restore --source=<rev> --staged <path> reset --hard -> restore --source=HEAD --staged --worktree :/ (not available now) -> restore --source=<rev> [--worktree] <path>

There are other behavior changes to improve things, e.g. --no-overlay is the default in "git restore". But those can't be shown in a cheatsheet. -- Duy

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 4 of 8 in “Feedback on git-restore”
  1. Poughon VictorMay 15, 2019
  2. Duy NguyenMay 15, 2019
  3. Ævar Arnfjörð BjarmasonMay 15, 2019
  4. Duy NguyenMay 15, 2019
  5. Junio C HamanoMay 16, 2019
  6. Philip OakleyMay 16, 2019
  7. Duy NguyenMay 16, 2019
  8. Philip OakleyMay 18, 2019

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.