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

Re: git push in --tracked branches.

From
Jeff King <peff@peff.net>
Date
Apr 22, 2010, 00:44 UTC
Message-ID
<20100422004433.GC14249@coredump.intra.peff.net>
In-Reply-To
<y2w3abd05a91004211702qf4cd42bau20ac52a4d35a6bf1@mail.gmail.com>
On Wed, Apr 21, 2010 at 08:02:49PM -0400, Aghiles wrote:
Show 10 quoted lines
> So I created a branch that tracks 'origin' which is remote:
> 
>   git checkout -b small_fixes origin
> 
> I can do a 'git pull' and everything works as expected. I did some
> commits in this branch and I issue a 'git push'. To my surprise
> the 'git push' is still operating on the master and not the current
> 'small_fixes' branch! What is the rationale behind this ? I would
> expect to push from my current branch to origin (especially that
> I am --tracking origin).

"git push" will by default push matching refs. This has been the behavior since day one. See the description of push.default in "git help config" for other options (I think you want "tracking").

-Peff
Previous: AghilesNext: Aghiles
Message 2 of 5 in “git push in --tracked branches.”
  1. AghilesApr 22, 2010
  2. Jeff KingApr 22, 2010
  3. AghilesApr 22, 2010
  4. Jeff KingApr 22, 2010
  5. AghilesApr 22, 2010

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.