RE: fetch and pull

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

 



=== Re: ===
If the local "dev" is meant to just track the remote, [that is the case]
you really ought to avoid doing anything very involved in it (unless
you're 
planning on merging something into it and pushing the result, that is!).
If
there's no local changes, then you can just pull with impunity, and
let it fast-forward - or use git merge or git rebase if you've already
fetched and don't want to spend the few seconds it takes to ask the
server if there's anything new :)
=== end ===

I thought about that.  But wouldn't that require you to checkout dev
first?  It seems that pull wants to merge into the current branch,
period.  That makes it unsuitable for something that just refreshes the
remote view of things, and is an accident waiting to happen if you run
it while on your topic branch instead.

=== Re: ===
Finally, if you really, truly, definitely want to blow away the
current branch and replace it with another one, you can use git reset
--hard. This will throw away (irretrievably) local uncommitted
changes, and force the current branch to point to the specified one.
=== end ===

"reset" does not change the current branch.  It updates the contents of
the working directory and index to match the node specified, but does
not change what git considers to be the branch you are "on".  I got a
few floating heads and later merge confusion before I finally understood
that.  It appears that "checkout" is the only thing that changes the
"current branch".  In any case, reset does not reposition any refs at
all.

=== Re: ===
Remember, you can undo most things using the reflog if you mess up,
including unwanted merges, git reset --hard (committed changes only)
etc.
=== end ===

Yes, indeed.

--John
(please excuse the footer; it's not my idea)

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