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

Re: how do you "force a pull"?

From
DWDavid Watson <dwatson@mimvista.com>
Date
Aug 25, 2007, 11:37 UTC
Message-ID
<20070825113747.GA21030@mimvista.com>
In-Reply-To
<20070825111946.GA7122@falcon.digizenstudio.com>

The commit you pulled should still be in your local repository (repo2), unless you've done something to deliberately remove it.

If you're using the default repository setup when cloning, then master branch of repo1 should be available as origin/master, so you can do the following:

$ git reset --hard origin/master
or log:
$ git log origin/master
If you want to see all your branches, local or remote:
$ git branch -r

Note that you shouldn't checkout origin/master and work on it, but rather you'll want to make a branch, and work on that:

$ git co -b fancy_branch origin/master

You may be getting the "cannot merge message" if you have uncommitted changes, as git won't let you merge when the working copy is changed. git-pull is really git-fetch + git-merge.

On Sat, Aug 25, 2007 at 07:19:46AM -0400, Jing Xue wrote:
Show 22 quoted lines
> I am working in repo1, and make a savepoint commit and pack up and leave.
> 
> On another machine, I have a clone of repo1 (repo2). So I pull from
> repo1, "git reset --soft HEAD" to get rid of the savepoint commit, and start working in repo2.
> 
> A while later I realize the earlier commit was actually a good commit
> point. But I can no longer pull it again from repo1. It keeps giving me
> the "Cannot merge" fatal error. "-f" doesn't help.
> 
> So in general my question is "how do you force pulling from a remote
> repository?"  (short of, you know, recloning the repo...)
> 
> I have a feeling that either I'm still stuck in the traditional central-repository
> mentality, or missing something real simple.
> 
> Thanks.
> -- 
> Jing Xue
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Dave Watson
Previous: Dan ChokolaNext: Jing Xue
Message 3 of 7 in “how do you "force a pull"?”
  1. Jing XueAug 25, 2007
  2. Dan ChokolaAug 25, 2007
  3. David WatsonAug 25, 2007
  4. Jing XueAug 25, 2007
  5. Randal L. SchwartzAug 25, 2007
  6. Fredrik TolfAug 26, 2007
  7. Jing XueAug 27, 2007

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.