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
Peter Krefting <peter@softwolves.pp.se>
Date
Mar 19, 2012, 09:07 UTC
Message-ID
<alpine.DEB.2.00.1203190945560.15290@ds9.cixit.se>
In-Reply-To
<7v7gyjersg.fsf@alter.siamese.dyndns.org>

At $dayjob, our setup instructions for Git do say that everyone setting up a new machine shall run "git config --global push.default tracking". This is what suits our workflow where people work on a topic branch, which they will push to and pull from our central repository (each topic branch is owned by a team of one or more developers). By using "tracking", they can just do a

   git push

and not have to worry about other half-finished or local changes "pollute" the One True Central Repository<tm>. We have found that this configuration makes it easier to explain the workflow, especially since it more or less does make "push" the opposite of "pull" (both of them just updating one "real" branch on either side).

We also have cases where we work on different repositories, with different codebases; we have an upstream codebase that is merged into one or more downstream codebases, and sometimes we have branches that are used with more than one codebase (pull branch A from upstream repo, merge with downstream repo and work with it there). Or we work on cross-codebase maintainence (transplant fix on branch A from codebase B to codebase C). We have installed hooks on our repositories that try to make sure history does not get pushed to the wrong repository -- as could sometimes happen if you had a branch checked out locally from the another codebase and forgot to configure your push.default.

I have also personally found that this is the setting that I do feel most comfortable with in more or less every other context where I work with Git, so I do think this would be a fairly useful default value.

I know the policy in Git is to not allow the remote repository dictate anything about the configuration in the local repository, but as an alternative to changing the "push.default" value, perhaps we should allow setting some configuration option on the remote repository that blocks it from being the target of a "push.default = matching" push?

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Sebastian SchuberthNext: Jonathan Nieder
Message 31 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.