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

Re: Please discuss: what "git push" should do when you do not say what to push?

From
Antony Male <antony.male@gmail.com>
Date
Mar 20, 2012, 02:27 UTC
Message-ID
<4F67EB1F.30205@gmail.com>
In-Reply-To
<7v7gyjersg.fsf@alter.siamese.dyndns.org>

This is my 2 cents from helping out on #git. I don't consider workflows at all, only how to minimise confusion for new users when they're trying to understand how git works.

We occasionally get users who are having trouble understanding why the argument-less form of 'git pull' is failing, due to lack of tracking configuration. We explain that the tracking config is git's way of "connecting" local and remote branches, and how to use 'git push -u' and 'git branch --set-upstream' appropriately.

This is all well and good -- they've discovered that local and remote branches are separate, that they aren't "magically" joined, that there's a bit of configuration data which "connects" the two, and how to manipulate it.

Users then assume that argument-less form of 'git push' uses the same mechanism. To then discover that it (by default) uses a different way of "connecting" local and remote branches is often confusing [1]. In addition, it can't be manipulated in the same way as the tracking config they learnt about before.

For this reason, I am in favour of push.default = upstream. Although it requires knowledge about setting up tracking config (in the cases where tracking config isn't set automatically), this knowledge has to be gained anyway for the argument-less form of 'git pull' to work.

[1]: Indeed, a lot of users only find out about this difference when it has bitten them in some way.

Thanks, Antony

Previous: Kevin BallardNext: Jakub Narebski
Message 35 of 43 in “Please discuss: what "git push" should do when you do not say what to push?”
  1. Junio C HamanoMar 17, 2012
  2. Junio C HamanoMar 17, 2012
  3. Andrew SayersMar 17, 2012
  4. Junio C HamanoMar 18, 2012
  5. Ævar Arnfjörð BjarmasonMar 18, 2012
  6. Junio C HamanoMar 19, 2012
  7. Sebastien DoucheMar 19, 2012
  8. Andrew SayersMar 19, 2012
  9. Junio C HamanoMar 19, 2012
  10. demerphqMar 19, 2012
  11. Junio C HamanoMar 19, 2012
  12. Andreas EricssonMar 20, 2012
  13. Andrew SayersMar 19, 2012
  14. Junio C HamanoMar 19, 2012
  15. Andrew SayersMar 20, 2012
  16. Junio C HamanoMar 20, 2012
  17. Andrew SayersMar 20, 2012
  18. Junio C HamanoMar 21, 2012
  19. Martin LanghoffMar 20, 2012
  20. Junio C HamanoMar 20, 2012
  21. Martin LanghoffMar 20, 2012
  22. Jakub NarebskiMar 20, 2012
  23. Summary of discussion on "git push" default changeJunio C Hamano, Mar 21, 2012
  24. Matthieu MoyMar 21, 2012
  25. Joey HessMar 17, 2012
  26. Junio C HamanoMar 19, 2012
  27. fREW SchmidtMar 17, 2012
  28. H. Peter AnvinMar 18, 2012
  29. Marcus D. HanwellMar 18, 2012
  30. Sebastian SchuberthMar 18, 2012
  31. Peter KreftingMar 19, 2012
  32. Letting remote repositories override local configurationJonathan Nieder, Mar 19, 2012
  33. Peter KreftingMar 19, 2012
  34. Kevin BallardMar 19, 2012
  35. Antony MaleMar 20, 2012
  36. Jakub NarebskiMar 20, 2012
  37. Antony MaleMar 20, 2012
  38. Nathan GrayMar 20, 2012
  39. Ben TebulinMar 20, 2012
  40. Ben TebulinMar 20, 2012
  41. Ben TebulinMar 20, 2012
  42. Ben TebulinMar 20, 2012
  43. Filipe FernandesMar 20, 2012

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.