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

Re: git newbie problems

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Dec 6, 2006, 22:19 UTC
Message-ID
<Pine.LNX.4.64.0612061637130.20138@iabervon.org>
In-Reply-To
<7v4ps9byca.fsf@assigned-by-dhcp.cox.net>
On Tue, 5 Dec 2006, Junio C Hamano wrote:
Show 14 quoted lines
> For new people, we recommend to:
> 
>  * make sure you were on a right branch (I think you are.  You
>    are on your 'master' branch and may not even have any other
>    branches, which is fine.)
> 
>  * make sure all your changes are committed.
> 
> before initiating a "git pull".  And after a conflicted "git
> pull", if you choose to punt,
> 
> 	$ git reset --hard
> 
> would take you back to the state before you started the pull.

If there are uncommitted changes, and there are conflicts, shouldn't it leave you in the state before the pull, especially if the uncommitted changes conflict with the merge? Git has determined that it can't present all of the conflicts to the user, so the user can't possibly resolve all of the conflicts, except by discarding new work or pushing it into the merge inappropriately.

I think that a lot of new users will pull with uncommitted changes, and they'd benefit from just being told that you're supposed to commit first and then merge. It should definitely roll back perfectly to the state before the pull if it wasn't able to present all the conflicts, since even somebody who knows what's going on is going to have to roll back here.

Possibly there should even be an option (defaulting to true) which completely blocks "pull" with uncommitted changes. Even if the in-index merge works (and the working directory is entirely unneeded), it's pretty likely that the user would do better to be in the habit of doing it in the other order anyway.

	-Daniel
Previous: Junio C HamanoNext: Tom Prince
Message 8 of 38 in “git newbie problems”
  1. Graham PercivalDec 6, 2006
  2. Jakub NarebskiDec 6, 2006
  3. Han-Wen NienhuysDec 6, 2006
  4. Jakub NarebskiDec 6, 2006
  5. Han-Wen NienhuysDec 6, 2006
  6. Johannes SchindelinDec 6, 2006
  7. Junio C HamanoDec 6, 2006
  8. Daniel BarkalowDec 6, 2006
  9. Tom PrinceDec 6, 2006
  10. Graham PercivalDec 6, 2006
  11. Han-Wen NienhuysDec 6, 2006
  12. Junio C HamanoDec 6, 2006
  13. Jakub NarebskiDec 6, 2006
  14. Han-Wen NienhuysDec 6, 2006
  15. cvs-migration document: make the need for "push" more obviousJohannes Schindelin, Dec 6, 2006
  16. Jakub NarebskiDec 6, 2006
  17. Johannes SchindelinDec 6, 2006
  18. Jakub NarebskiDec 6, 2006
  19. New users, was Re: [PATCH] cvs-migration document: make the need for "push" more obviousJohannes Schindelin, Dec 6, 2006
  20. J. Bruce FieldsDec 6, 2006
  21. Han-Wen NienhuysDec 6, 2006
  22. J. Bruce FieldsDec 6, 2006
  23. Han-Wen NienhuysDec 6, 2006
  24. Johannes SchindelinDec 6, 2006
  25. J. Bruce FieldsDec 6, 2006
  26. J. Bruce FieldsDec 6, 2006
  27. Junio C HamanoDec 6, 2006
  28. Documentation: reorganize cvs-migration.txtJ. Bruce Fields, Dec 7, 2006
  29. Junio C HamanoDec 7, 2006
  30. J. Bruce FieldsDec 7, 2006
  31. Johannes SchindelinDec 7, 2006
  32. J. Bruce FieldsDec 7, 2006
  33. Johannes SchindelinDec 7, 2006
  34. J. Bruce FieldsDec 8, 2006
  35. Junio C HamanoDec 8, 2006
  36. J. Bruce FieldsDec 9, 2006
  37. Graham PercivalDec 6, 2006
  38. J. Bruce FieldsDec 6, 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.