RE: More help with "pull" please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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?

> 
> $ 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux