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

Re: Using the --track option when creating a branch

From
Bill Lear <rael@zopyra.com>
Date
Oct 30, 2008, 15:42 UTC
Message-ID
<18697.54743.601331.133842@lisa.zopyra.com>
In-Reply-To
<4909D1FE.2080403@op5.se>
On Thursday, October 30, 2008 at 16:25:50 (+0100) Andreas Ericsson writes:
Show 24 quoted lines
>Samuel Tardieu wrote:
>> * Andreas Ericsson <ae@op5.se> [2008-10-30 15:54:53 +0100]
>> 
>>> Correct me if I'm wrong, but wouldn't my suggestion of not trying to
>>> push (even matching) branches that haven't been updated since we last
>>> fetched from the remote do exactly the same thing for your particular
>>> use-case, but without syntax change and all the annoying minor parts
>>> that it entails?
>> 
>> Not exactly. I often do some work on a branch which does not mandate
>> a topic branch and have to switch branches to fix a bug for example.
>> This would continue to push unterminated changes as well.
>> 
>> Typical use case, which happens (to me) quite frequently:
>> 
>
>...
>
>>
>> Argh, "master" has been pushed as well. Ok, I could have done
>> 
>
>Ah, I see. I sympathize, although I really do think you'd be
>better off by learning to explicitly push things.

Exactly my concerns when I raised this issue originally. It's hard to teach people to do this:

% git push origin master
or:
% git pull origin master
so that when they intend and MUST do this (lest chaos ensue):
% git push origin ReleaseBranch
or this:
% git pull origin ReleaseBranch
they don't mistakenly do this:
% git push
or:
% git pull

the reason being that every manual our users read says "use git push", use "git pull", the examples being written for 'master' branch usage, and people just assume that 'git push'/'git pull' are smart enough to know which branch you are on and do the same logical thing as a bare 'git push'/'git pull' does when on master.

Several times this has happened to us: people make this mistake and push or pull stuff into a branch they do not want. The pull is not so bad, but the push messes up our central repo. This has happened both here at my current company, and my previous one, and the persons making the mistakes are neither sloppy nor inexperienced.

Bill
Previous: Andreas EricssonNext: Marc Branchaud
Message 17 of 23 in “Using the --track option when creating a branch”
  1. Bill LearOct 29, 2008
  2. Santi BéjarOct 29, 2008
  3. Bill LearOct 29, 2008
  4. Sam VilainOct 30, 2008
  5. Bill LearOct 30, 2008
  6. Bill LearOct 30, 2008
  7. Andreas EricssonOct 30, 2008
  8. Samuel TardieuOct 30, 2008
  9. Andreas EricssonOct 30, 2008
  10. Samuel TardieuOct 30, 2008
  11. Pierre HabouzitOct 30, 2008
  12. Samuel TardieuOct 30, 2008
  13. Sam VilainOct 30, 2008
  14. Andreas EricssonOct 30, 2008
  15. Samuel TardieuOct 30, 2008
  16. Andreas EricssonOct 30, 2008
  17. Bill LearOct 30, 2008
  18. Marc BranchaudOct 30, 2008
  19. Sam VilainOct 30, 2008
  20. Jakub NarebskiOct 30, 2008
  21. Jeff KingNov 2, 2008
  22. Sam VilainOct 30, 2008
  23. Santi BéjarOct 30, 2008

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.