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

fetch and pull

From
JDJohn Dlugosz <jdlugosz@tradestation.com>
Date
Mar 6, 2009, 19:04 UTC
Message-ID
<450196A1AAAE4B42A00A8B27A59278E70A115E0D@EXCHANGE.trad.tradestation.com>

I've gotten the hang of git well enough to pretty much bang on it until I achieve what I wanted to happen, though maybe trying a few things and recovering from mistakes or taking the long way around.

Now I'm putting together a cookbook for our team, to allow use of topic branches rather than treating it simply as a faster SourceSafe.

I want to advocate running
	git fetch

as being a safe thing to do at any time, just to refresh your view of the origin and not mess up any of your local labels. That is, you can see the difference between the local dev and the origin/dev.

So, after inspecting the changes, how do you fast-forward your local dev to sync up with origin/dev?

I'm worried that
	git pull origin dev

will try to merge into the current head. The documentation indicates "The remote ref that matches <src> is fetched, and if <dst> is not empty string, the local ref that matches it is fast forwarded using <src>." which is what I want, but it does NOT say that the normal behavior of merging origin/dev into the =current= HEAD, if it happens to not be the local dev.

So, does it indeed suppress that behavior if you give it an explicit destination? Or will I have to checkout dev first before doing the pull, to prevent strange things from happening? Hmm, or perhaps I should be using merge, not pull? After all, pull is really just a wrapper around fetch and then merge, right? So is it OK to call merge when I really want to fast-forward, and is there an option to give an error if it isn't ff?

--John (sorry about 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.
Next: Junio C Hamano
Message 1 of 10 in “fetch and pull”
  1. John DlugoszMar 6, 2009
  2. Junio C HamanoMar 6, 2009
  3. Jakub NarebskiMar 6, 2009
  4. Junio C HamanoMar 6, 2009
  5. John DlugoszMar 6, 2009
  6. Junio C HamanoMar 6, 2009
  7. Bryan DonlanMar 7, 2009
  8. Junio C HamanoMar 7, 2009
  9. John DlugoszMar 9, 2009
  10. John DlugoszMar 9, 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.