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

RE: More help with "pull" please

From
JDJohn Dlugosz <jdlugosz@tradestation.com>
Date
Apr 1, 2009, 22:53 UTC
Message-ID
<450196A1AAAE4B42A00A8B27A59278E70A7D4E71@EXCHANGE.trad.tradestation.com>
In-Reply-To
<4659A860-4AF5-4E34-B38E-60C926E2BAE1@dbservice.com>
Show 14 quoted lines
> When you create a branch, you can tell git which remote branch it
> tracks, like this:
> 
> $ git branch --track mynext origin/next
> 
> So whenever you are on brach 'mynext' and do a git-pull, it will fetch
> and merge origin/next.
> 
> You can do the same with the git-checkout command:
> 
> $ git checkout --track origin/next
> 
> This will create a local branch 'next' which tracks 'origin/next'
> 

OK, that works by adding something to the config file, right? The docs don't say, but does mention "having Pull: <refspec> lines for a <repository>". Does tracking add Pull: lines, or is that another feature?

Show 6 quoted lines
> 
> $ git clone $url XXX
> $ cd XXX
> $ git checkout --track origin/ReleaseCandidate
> ...
> $ git pull # will automatically fetch and merge
origin/ReleaseCandidate

According to the manpage on pull, "While git-pull run without any explicit <refspec> parameter takes default <refspec>s from Pull: lines, it merges only the first <refspec> found into the current branch, after fetching all the remote refs."

Also, "When no refspec was given on the command line ... If branch.<name>.merge configuration for the current branch <name> exists, that is the name of the branch at the remote site that is merged." So is that yet again different from having Pull: lines? If so, I'm fine if no "Pull:" lines exist, or it would merge the first refspec found there.

Also, "Normally the branch merged in is the HEAD of the remote repository, but the choice is determined by the branch.<name>.remote and branch.<name>.merge options; see git-config(1) for details." That agrees with the previous. If branch.<name>.merge configuration exists, I don't need to worry about the remote HEAD.

> $ git checkout --track origin/ReleaseCandidate

That command does not work. It compains that --track can only be used with -b, etc.

I think 
	git checkout -b origin/ReleaseCandidate
is the correct shortcut?  
	git checkout -b ReleaseCandidate origin/ReleaseCandidate

did work. I know that --track is automatic if the second argument is remote.

--John
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.
Previous: Tomas CarneckyNext: Tomas Carnecky
Message 3 of 8 in “More help with "pull" please”
  1. John DlugoszApr 1, 2009
  2. Tomas CarneckyApr 1, 2009
  3. John DlugoszApr 1, 2009
  4. Tomas CarneckyApr 1, 2009
  5. John DlugoszApr 1, 2009
  6. Junio C HamanoApr 2, 2009
  7. John DlugoszApr 2, 2009
  8. Tomas CarneckyApr 2, 2009

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.