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

cache status after git pull

From
tony.luck@intel.com <tony.luck@intel.com>
Date
Aug 25, 2005, 16:08 UTC
Message-ID
<200508251608.j7PG8XGq016882@agluck-lia64.sc.intel.com>
Show 6 quoted lines
>* When the branch head pointed by $GIT_DIR/HEAD changes while
> the index file and working tree are looking the other way
> (e.g. somebody pushed into your repository, or you ran "git
> fetch" to update the ref your working tree is on), "git
> checkout" without -f gets confused.  Figure out a good way to
> handle this.

Aha ... is this the problem that caught me out last week (when I ended up with 10 extra files attached to one of my commits)? At the time the blame was placed on a failed merge not being backed out correctly. But I only had the failed merge because "get checkout" had failed to switch branches (and not provided an exit code to stop my script from trying the merge).

Here's what I did this morning.
1) Updated my "linus" branch:
  $ git checkout linus && git pull linus

This appeared to work just fine ... except that when I check the status of my tree I see:

  $ git status
  #
  # Updated but not checked in:
  #   (will commit)
  #
  #       modified: arch/ia64/pci/pci.c
  #       modified: arch/ppc64/kernel/setup.c
  #       modified: arch/sparc64/kernel/pci.c
  #       modified: arch/x86_64/defconfig
  #       modified: drivers/block/cfq-iosched.c
  #       modified: include/asm-m68k/page.h
  #       modified: kernel/cpuset.c
  #
  #
  # On branch refs/heads/linus
  
Which looks like a set of landmines just waiting for me to
step on them!

Today these didn't bite me. "git checkout release" worked and switched to my release branch (and git status went back to saying "nothing to commit"). But in the past I think this is the situation that has caused "git checkout" to fail with the "fatal: Entry 'blah' would be overwritten by merge. Cannot merge."

-Tony
Next: Junio C Hamano
Message 1 of 2 in “cache status after git pull”
  1. tony.luck@intel.comAug 25, 2005
  2. Junio C HamanoAug 25, 2005

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.