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

Re: The git newbie experience

From
Shawn Pearce <spearce@spearce.org>
Date
May 15, 2006, 05:27 UTC
Message-ID
<20060515052728.GA28068@spearce.org>
In-Reply-To
<44680C54.8040206@inoi.fi>
Tommi Virtanen <tv@inoi.fi> wrote:
> Junio C Hamano wrote:
[snip]
Show 20 quoted lines
> > - Jack stashes away what he has been working on and cleans up
> >   his mess.
> > 
> >   git diff >P.diff
> >   git checkout HEAD A B C
> ...
> > - Jack then reapplies what he stashed away with "git apply P.diff"
> >   and keeps working.
> > 
> > Maybe "git stash" command that does "git diff --full-index" with
> > some frills, and "git unstash" command which does an equivalent
> > of "git am -3" would help this workflow (bare "git apply" does
> > not do the three-way merge like am does).
> 
> Oh, I'd love to have a quick stash, that's what we actually ended up
> doing a lot. Although I'd rather see a real implementation use a branch
> and not just a diff file, but.. yes please.
> 
> Although, "git stash" and "git unstash" are yet another command to add
> to the newbie set, and I just complained about the size of the set ;)

This is perhaps one area where SVN's user interface is actually nice. SVN's equiv. of stash is making a copy of your working directory into the repository; something that is rather simple to do for the user.

What about "git commit -b foo -a" to commit the current working directory to branch 'foo'?

Then restoring is a pull of foo ("git pull . foo"), but that intermediate commit is now part of the repository history. And "git commit -a" doesn't automatically add extra/other files to the repository and it probably should in the case of a "stash".

-- 
Shawn.
Previous: Junio C Hamano
Message 12 of 12 in “The git newbie experience”
  1. Tommi VirtanenMay 14, 2006
  2. Junio C HamanoMay 14, 2006
  3. Junio C HamanoMay 14, 2006
  4. Tommi VirtanenMay 15, 2006
  5. Junio C HamanoMay 15, 2006
  6. Shawn PearceMay 15, 2006
  7. Junio C HamanoMay 15, 2006
  8. Carl BaldwinMay 15, 2006
  9. Junio C HamanoMay 15, 2006
  10. Carl WorthMay 15, 2006
  11. Junio C HamanoMay 15, 2006
  12. Shawn PearceMay 15, 2006

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.