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

How to force a pull to succeed?

From
JWJeffrey Walton <noloader@gmail.com>
Date
May 16, 2017, 02:17 UTC
Message-ID
<CAH8yC8k8sTGDA=C8vLCE090Y1B4TK86bOnZMNjj13C-JXVEBHQ@mail.gmail.com>

I scp'd a file to another machine for testing. The change tested OK, so I checked it in on the original machine.

I'm now on the remote machine, and I'm trying to pull the same exact file that exists on both local and remote. Git won't allow me to do it, even with -f.

I'd really like -f (or another switch) to work as expected. I don't like issuing extra command or extra typing.

How do I force the pull to succeed?
Thanks in adavnce.
**************
qotom:cryptopp$ git pull
Updating 30ac06d..30ac53f
error: Your local changes to the following files would be overwritten by merge:
        datatest.cpp
Please commit your changes or stash them before you merge.
Aborting
qotom:cryptopp$ git pull -f
Updating 30ac06d..30ac53f
error: Your local changes to the following files would be overwritten by merge:
        datatest.cpp
Please commit your changes or stash them before you merge.
Next: Junio C Hamano
Message 1 of 6 in “How to force a pull to succeed?”
  1. Jeffrey WaltonMay 16, 2017
  2. Junio C HamanoMay 16, 2017
  3. Jeffrey WaltonMay 16, 2017
  4. Junio C HamanoMay 16, 2017
  5. Jeffrey WaltonMay 16, 2017
  6. Jeff KingMay 16, 2017

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.