Skip to content

Instantly share code, notes, and snippets.

@haad
Created May 8, 2012 12:23
Show Gist options
  • Save haad/2634549 to your computer and use it in GitHub Desktop.
Save haad/2634549 to your computer and use it in GitHub Desktop.
git pull problem on NetBSD jsonn/src repo
[haad@musasi gsrc]$ git pull
remote: Counting objects: 4365, done.
remote: Compressing objects: 100% (465/465), done.
remote: Total 2517 (delta 1982), reused 2505 (delta 1970)
Receiving objects: 100% (2517/2517), 3.45 MiB | 181 KiB/s, done.
Resolving deltas: 100% (1982/1982), completed with 471 local objects.
From git://github.com/jsonn/src
+ 7f5b29e...e0faadd trunk -> origin/trunk (forced update)
a5dd56e..3b6ef9c JSEWARD -> origin/JSEWARD
* [new branch] agc_netpgp_standalone -> origin/agc_netpgp_standalone
3238d9f..0cbde55 matt_nb5_mips64 -> origin/matt_nb5_mips64
4445b7b..d8b2d60 netbsd_6 -> origin/netbsd_6
Auto-merging usr.sbin/makemandb/makemandb.c
CONFLICT (content): Merge conflict in usr.sbin/makemandb/makemandb.c
Removing usr.bin/tset/wrterm.c
Removing sys/kern/kern_malloc_stdtype.c
Removing sys/kern/kern_malloc_debug.c
Auto-merging sys/arch/x86/x86/db_memrw.c
Removing sys/arch/x68k/dev/com.c
Removing sys/arch/i386/i386/db_memrw.c
Auto-merging sys/arch/amd64/amd64/vector.S
CONFLICT (content): Merge conflict in sys/arch/amd64/amd64/vector.S
Auto-merging lib/libc/compat/stdlib/compat_putenv.c
CONFLICT (add/add): Merge conflict in lib/libc/compat/stdlib/compat_putenv.c
CONFLICT (modify/delete): external/bsd/llvm/lib/libclangIndex/Makefile deleted in e0faadd479eb8b796dc15d37f692dd3b0758a082 and modified in HEAD. Version HEAD of external/bsd/llvm/lib/libclangIndex/Makefile left in tree.
Removing external/bsd/llvm/bin/llvm-stub/Makefile
CONFLICT (modify/delete): external/bsd/llvm/bin/llvm-ld/Makefile deleted in e0faadd479eb8b796dc15d37f692dd3b0758a082 and modified in HEAD. Version HEAD of external/bsd/llvm/bin/llvm-ld/Makefile left in tree.
Auto-merging external/bsd/bzip2/dist/xmlproc.sh
Auto-merging external/bsd/bzip2/dist/unzcrash.c
Auto-merging external/bsd/bzip2/dist/spewG.c
Auto-merging external/bsd/bzip2/dist/randtable.c
Auto-merging external/bsd/bzip2/dist/mk251.c
Auto-merging external/bsd/bzip2/dist/manual.xml
Auto-merging external/bsd/bzip2/dist/manual.html
Auto-merging external/bsd/bzip2/dist/huffman.c
Auto-merging external/bsd/bzip2/dist/format.pl
Auto-merging external/bsd/bzip2/dist/entities.xml
Auto-merging external/bsd/bzip2/dist/dlltest.c
Auto-merging external/bsd/bzip2/dist/decompress.c
Auto-merging external/bsd/bzip2/dist/crctable.c
Auto-merging external/bsd/bzip2/dist/compress.c
Auto-merging external/bsd/bzip2/dist/bzmore.1
Auto-merging external/bsd/bzip2/dist/bzlib_private.h
Auto-merging external/bsd/bzip2/dist/bzlib.h
Auto-merging external/bsd/bzip2/dist/bzlib.c
Auto-merging external/bsd/bzip2/dist/bzip2recover.c
Auto-merging external/bsd/bzip2/dist/bzip2.c
Auto-merging external/bsd/bzip2/dist/bzip2.1
Auto-merging external/bsd/bzip2/dist/bzgrep.1
Auto-merging external/bsd/bzip2/dist/bzdiff.1
Auto-merging external/bsd/bzip2/dist/blocksort.c
Auto-merging external/bsd/bzip2/dist/README.XML.STUFF
Auto-merging external/bsd/bzip2/dist/README.COMPILATION.PROBLEMS
Auto-merging external/bsd/bzip2/dist/README
Auto-merging external/bsd/bzip2/dist/Makefile-libbz2_so
Auto-merging external/bsd/bzip2/dist/Makefile
Auto-merging external/bsd/bzip2/dist/LICENSE
Auto-merging external/bsd/bzip2/dist/CHANGES
Auto-merging external/bsd/bzip2/bzip2netbsd
Auto-merging doc/3RDPARTY
CONFLICT (content): Merge conflict in doc/3RDPARTY
Automatic merge failed; fix conflicts and then commit the result.
[haad@musasi gsrc]$ git reset hard
fatal: ambiguous argument 'hard': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
[haad@musasi gsrc]$ git reset --hard
HEAD is now at 069d750 Update to current.
[haad@musasi gsrc]$ git merge -X theirs origin/trunk
Auto-merging usr.sbin/makemandb/makemandb.c
Removing usr.bin/tset/wrterm.c
Removing sys/kern/kern_malloc_stdtype.c
Removing sys/kern/kern_malloc_debug.c
Auto-merging sys/arch/x86/x86/db_memrw.c
Removing sys/arch/x68k/dev/com.c
Removing sys/arch/i386/i386/db_memrw.c
Auto-merging sys/arch/amd64/amd64/vector.S
Auto-merging lib/libc/compat/stdlib/compat_putenv.c
CONFLICT (modify/delete): external/bsd/llvm/lib/libclangIndex/Makefile deleted in origin/trunk and modified in HEAD. Version HEAD of external/bsd/llvm/lib/libclangIndex/Makefile left in tree.
Removing external/bsd/llvm/bin/llvm-stub/Makefile
CONFLICT (modify/delete): external/bsd/llvm/bin/llvm-ld/Makefile deleted in origin/trunk and modified in HEAD. Version HEAD of external/bsd/llvm/bin/llvm-ld/Makefile left in tree.
Auto-merging external/bsd/bzip2/dist/xmlproc.sh
Auto-merging external/bsd/bzip2/dist/unzcrash.c
Auto-merging external/bsd/bzip2/dist/spewG.c
Auto-merging external/bsd/bzip2/dist/randtable.c
Auto-merging external/bsd/bzip2/dist/mk251.c
Auto-merging external/bsd/bzip2/dist/manual.xml
Auto-merging external/bsd/bzip2/dist/manual.html
Auto-merging external/bsd/bzip2/dist/huffman.c
Auto-merging external/bsd/bzip2/dist/format.pl
Auto-merging external/bsd/bzip2/dist/entities.xml
Auto-merging external/bsd/bzip2/dist/dlltest.c
Auto-merging external/bsd/bzip2/dist/decompress.c
Auto-merging external/bsd/bzip2/dist/crctable.c
Auto-merging external/bsd/bzip2/dist/compress.c
Auto-merging external/bsd/bzip2/dist/bzmore.1
Auto-merging external/bsd/bzip2/dist/bzlib_private.h
Auto-merging external/bsd/bzip2/dist/bzlib.h
Auto-merging external/bsd/bzip2/dist/bzlib.c
Auto-merging external/bsd/bzip2/dist/bzip2recover.c
Auto-merging external/bsd/bzip2/dist/bzip2.c
Auto-merging external/bsd/bzip2/dist/bzip2.1
Auto-merging external/bsd/bzip2/dist/bzgrep.1
Auto-merging external/bsd/bzip2/dist/bzdiff.1
Auto-merging external/bsd/bzip2/dist/blocksort.c
Auto-merging external/bsd/bzip2/dist/README.XML.STUFF
Auto-merging external/bsd/bzip2/dist/README.COMPILATION.PROBLEMS
Auto-merging external/bsd/bzip2/dist/README
Auto-merging external/bsd/bzip2/dist/Makefile-libbz2_so
Auto-merging external/bsd/bzip2/dist/Makefile
Auto-merging external/bsd/bzip2/dist/LICENSE
Auto-merging external/bsd/bzip2/dist/CHANGES
Auto-merging external/bsd/bzip2/bzip2netbsd
Auto-merging doc/3RDPARTY
Automatic merge failed; fix conflicts and then commit the result.
remotes/origin/zlib
[haad@musasi gsrc]$ git branch -a | grep trun
* trunk
remotes/origin/HEAD -> origin/trunk
remotes/origin/trunk
[haad@musasi gsrc]$ git merge -X theirs origin/HEAD
Auto-merging usr.sbin/makemandb/makemandb.c
Removing usr.bin/tset/wrterm.c
Removing sys/kern/kern_malloc_stdtype.c
Removing sys/kern/kern_malloc_debug.c
Auto-merging sys/arch/x86/x86/db_memrw.c
Removing sys/arch/x68k/dev/com.c
Removing sys/arch/i386/i386/db_memrw.c
Auto-merging sys/arch/amd64/amd64/vector.S
Auto-merging lib/libc/compat/stdlib/compat_putenv.c
CONFLICT (modify/delete): external/bsd/llvm/lib/libclangIndex/Makefile deleted in origin/HEAD and modified in HEAD. Version HEAD of external/bsd/llvm/lib/libclangIndex/Makefile left in tree.
Removing external/bsd/llvm/bin/llvm-stub/Makefile
CONFLICT (modify/delete): external/bsd/llvm/bin/llvm-ld/Makefile deleted in origin/HEAD and modified in HEAD. Version HEAD of external/bsd/llvm/bin/llvm-ld/Makefile left in tree.
Auto-merging external/bsd/bzip2/dist/xmlproc.sh
Auto-merging external/bsd/bzip2/dist/unzcrash.c
Auto-merging external/bsd/bzip2/dist/spewG.c
Auto-merging external/bsd/bzip2/dist/randtable.c
Auto-merging external/bsd/bzip2/dist/mk251.c
Auto-merging external/bsd/bzip2/dist/manual.xml
Auto-merging external/bsd/bzip2/dist/manual.html
Auto-merging external/bsd/bzip2/dist/huffman.c
Auto-merging external/bsd/bzip2/dist/format.pl
Auto-merging external/bsd/bzip2/dist/entities.xml
Auto-merging external/bsd/bzip2/dist/dlltest.c
Auto-merging external/bsd/bzip2/dist/decompress.c
Auto-merging external/bsd/bzip2/dist/crctable.c
Auto-merging external/bsd/bzip2/dist/compress.c
Auto-merging external/bsd/bzip2/dist/bzmore.1
Auto-merging external/bsd/bzip2/dist/bzlib_private.h
Auto-merging external/bsd/bzip2/dist/bzlib.h
Auto-merging external/bsd/bzip2/dist/bzlib.c
Auto-merging external/bsd/bzip2/dist/bzip2recover.c
Auto-merging external/bsd/bzip2/dist/bzip2.c
Auto-merging external/bsd/bzip2/dist/bzip2.1
Auto-merging external/bsd/bzip2/dist/bzgrep.1
Auto-merging external/bsd/bzip2/dist/bzdiff.1
Auto-merging external/bsd/bzip2/dist/blocksort.c
Auto-merging external/bsd/bzip2/dist/README.XML.STUFF
Auto-merging external/bsd/bzip2/dist/README.COMPILATION.PROBLEMS
Auto-merging external/bsd/bzip2/dist/README
Auto-merging external/bsd/bzip2/dist/Makefile-libbz2_so
Auto-merging external/bsd/bzip2/dist/Makefile
Auto-merging external/bsd/bzip2/dist/LICENSE
Auto-merging external/bsd/bzip2/dist/CHANGES
Auto-merging external/bsd/bzip2/bzip2netbsd
Auto-merging doc/3RDPARTY
Automatic merge failed; fix conflicts and then commit the result.
[haad@musasi gsrc]$ cat .git/HEAD
ref: refs/heads/trunk
[haad@musasi gsrc]$ git status
# On branch trunk
# Your branch and 'origin/trunk' have diverged,
# and have 208550 and 253 different commits each, respectively.
#
# Changes to be committed:
#
# modified: UPDATING
# modified: bin/ps/ps.c
# modified: bin/rcp/rcp.c
# modified: doc/3RDPARTY
# modified: doc/BRANCHES
# renamed: dist/bzip2/bzip2netbsd -> external/bsd/bzip2/bzip2netbsd
# renamed: dist/bzip2/CHANGES -> external/bsd/bzip2/dist/CHANGES
# renamed: dist/bzip2/LICENSE -> external/bsd/bzip2/dist/LICENSE
# renamed: dist/bzip2/Makefile -> external/bsd/bzip2/dist/Makefile
# renamed: dist/bzip2/Makefile-libbz2_so -> external/bsd/bzip2/dist/Makefile-libbz2_so
# renamed: dist/bzip2/README -> external/bsd/bzip2/dist/README
# renamed: dist/bzip2/README.COMPILATION.PROBLEMS -> external/bsd/bzip2/dist/README.COMPILATION.PROBLEMS
# renamed: dist/bzip2/README.XML.STUFF -> external/bsd/bzip2/dist/README.XML.STUFF
# renamed: dist/bzip2/blocksort.c -> external/bsd/bzip2/dist/blocksort.c
# renamed: dist/bzip2/bz-common.xsl -> external/bsd/bzip2/dist/bz-common.xsl
# renamed: dist/bzip2/bz-fo.xsl -> external/bsd/bzip2/dist/bz-fo.xsl
# renamed: dist/bzip2/bz-html.xsl -> external/bsd/bzip2/dist/bz-html.xsl
# renamed: dist/bzip2/bzdiff -> external/bsd/bzip2/dist/bzdiff
# renamed: dist/bzip2/bzdiff.1 -> external/bsd/bzip2/dist/bzdiff.1
# renamed: dist/bzip2/bzgrep -> external/bsd/bzip2/dist/bzgrep
# renamed: dist/bzip2/bzgrep.1 -> external/bsd/bzip2/dist/bzgrep.1
# renamed: dist/bzip2/bzip.css -> external/bsd/bzip2/dist/bzip.css
# renamed: dist/bzip2/bzip2.1 -> external/bsd/bzip2/dist/bzip2.1
# renamed: dist/bzip2/bzip2.c -> external/bsd/bzip2/dist/bzip2.c
# renamed: dist/bzip2/bzip2recover.c -> external/bsd/bzip2/dist/bzip2recover.c
# renamed: dist/bzip2/bzlib.c -> external/bsd/bzip2/dist/bzlib.c
# renamed: dist/bzip2/bzlib.h -> external/bsd/bzip2/dist/bzlib.h
# renamed: dist/bzip2/bzlib_private.h -> external/bsd/bzip2/dist/bzlib_private.h
# renamed: dist/bzip2/bzmore -> external/bsd/bzip2/dist/bzmore
# renamed: dist/bzip2/bzmore.1 -> external/bsd/bzip2/dist/bzmore.1
# renamed: dist/bzip2/compress.c -> external/bsd/bzip2/dist/compress.c
# renamed: dist/bzip2/crctable.c -> external/bsd/bzip2/dist/crctable.c
# renamed: dist/bzip2/decompress.c -> external/bsd/bzip2/dist/decompress.c
# renamed: dist/bzip2/dlltest.c -> external/bsd/bzip2/dist/dlltest.c
# renamed: dist/bzip2/dlltest.dsp -> external/bsd/bzip2/dist/dlltest.dsp
# renamed: dist/bzip2/entities.xml -> external/bsd/bzip2/dist/entities.xml
# renamed: dist/bzip2/format.pl -> external/bsd/bzip2/dist/format.pl
# renamed: dist/bzip2/huffman.c -> external/bsd/bzip2/dist/huffman.c
# renamed: dist/bzip2/libbz2.def -> external/bsd/bzip2/dist/libbz2.def
# renamed: dist/bzip2/libbz2.dsp -> external/bsd/bzip2/dist/libbz2.dsp
# renamed: dist/bzip2/makefile.msc -> external/bsd/bzip2/dist/makefile.msc
# renamed: dist/bzip2/manual.html -> external/bsd/bzip2/dist/manual.html
# renamed: dist/bzip2/manual.xml -> external/bsd/bzip2/dist/manual.xml
# renamed: dist/bzip2/mk251.c -> external/bsd/bzip2/dist/mk251.c
# renamed: dist/bzip2/randtable.c -> external/bsd/bzip2/dist/randtable.c
# renamed: dist/bzip2/sample1.bz2 -> external/bsd/bzip2/dist/sample1.bz2
# renamed: dist/bzip2/sample1.ref -> external/bsd/bzip2/dist/sample1.ref
# renamed: dist/bzip2/sample2.bz2 -> external/bsd/bzip2/dist/sample2.bz2
# renamed: dist/bzip2/sample2.ref -> external/bsd/bzip2/dist/sample2.ref
# renamed: dist/bzip2/sample3.bz2 -> external/bsd/bzip2/dist/sample3.bz2
# renamed: dist/bzip2/sample3.ref -> external/bsd/bzip2/dist/sample3.ref
# renamed: dist/bzip2/spewG.c -> external/bsd/bzip2/dist/spewG.c
# renamed: dist/bzip2/unzcrash.c -> external/bsd/bzip2/dist/unzcrash.c
# renamed: dist/bzip2/words0 -> external/bsd/bzip2/dist/words0
# renamed: dist/bzip2/words1 -> external/bsd/bzip2/dist/words1
# renamed: dist/bzip2/words2 -> external/bsd/bzip2/dist/words2
# renamed: dist/bzip2/words3 -> external/bsd/bzip2/dist/words3
# renamed: dist/bzip2/xmlproc.sh -> external/bsd/bzip2/dist/xmlproc.sh
# deleted: external/bsd/llvm/bin/llvm-stub/Makefile
# modified: lib/libbz2/Makefile
# modified: lib/libc/compat/stdlib/compat_putenv.c
# modified: sys/arch/amd64/amd64/vector.S
# modified: sys/arch/amd64/conf/files.amd64
# modified: sys/arch/amd64/include/frameasm.h
# modified: sys/arch/amd64/include/vmparam.h
# modified: sys/arch/amiga/include/bus.h
# modified: sys/arch/amiga/include/pci_machdep.h
# modified: sys/arch/cesfic/include/bus.h
# modified: sys/arch/hp300/include/bus.h
# modified: sys/arch/i386/conf/files.i386
# deleted: sys/arch/i386/i386/db_memrw.c
# modified: sys/arch/i386/include/vmparam.h
# modified: sys/arch/luna68k/include/bus.h
# modified: sys/arch/news68k/include/bus.h
# modified: sys/arch/powerpc/booke/dev/pq3etsec.c
# modified: sys/arch/powerpc/include/booke/etsecreg.h
# deleted: sys/arch/x68k/dev/com.c
# deleted: sys/arch/x68k/dev/comreg.h
# modified: sys/arch/x68k/dev/fd.c
# modified: sys/arch/x68k/x68k/machdep.c
# modified: sys/arch/x86/conf/files.x86
# renamed: sys/arch/amd64/amd64/db_memrw.c -> sys/arch/x86/x86/db_memrw.c
# modified: sys/arch/xen/conf/files.xen
# modified: sys/arch/zaurus/dev/zkbdmap.h
# modified: sys/dev/scsipi/cd.c
# deleted: sys/kern/kern_malloc_debug.c
# deleted: sys/kern/kern_malloc_stdtype.c
# modified: sys/miscfs/procfs/procfs_map.c
# modified: sys/net/npf/npf_handler.c
# modified: sys/net/npf/npf_impl.h
# modified: sys/net/npf/npf_sendpkt.c
# modified: sys/rump/dev/lib/libscsitest/scsitest.c
# modified: sys/sys/bus.h
# modified: tests/dev/scsipi/t_cd.c
# modified: tests/usr.bin/bzip2/Makefile
# modified: usr.bin/bzip2/Makefile
# modified: usr.bin/bzip2recover/Makefile
# modified: usr.bin/grep/grep.c
# modified: usr.bin/grep/grep.h
# modified: usr.bin/grep/util.c
# deleted: usr.bin/tset/wrterm.c
# modified: usr.sbin/makemandb/DBSCHEMA
# modified: usr.sbin/makemandb/apropos-utils.c
# modified: usr.sbin/makemandb/apropos-utils.h
# modified: usr.sbin/makemandb/makemandb.c
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# deleted by them: external/bsd/llvm/bin/llvm-ld/Makefile
# deleted by them: external/bsd/llvm/lib/libclangIndex/Makefile
#
[haad@musasi gsrc]$ git rm external/bsd/llvm/bin/llvm-ld/Makefile
external/bsd/llvm/bin/llvm-ld/Makefile: needs merge
rm 'external/bsd/llvm/bin/llvm-ld/Makefile'
[haad@musasi gsrc]$ git rm external/bsd/llvm/lib/libclangIndex/Makefile
external/bsd/llvm/lib/libclangIndex/Makefile: needs merge
rm 'external/bsd/llvm/lib/libclangIndex/Makefile'
[haad@musasi gsrc]$ git add .
[haad@musasi gsrc]$ git commit -m 'Merge to -current'
@robohack
Copy link

This just happened to me as well, again, today.

I'm assuming you haven't made any local changes/commits....

I.e. you've just done: git clone ... wait some time ... git pull

I don't know why this happens, but it is either a git bug or a bug in the CVS to git conversion. (In original git repositories this can also happen if someone idiot rewrites the history in their repo after already pushing their changes, then forces a push of their rewritten history, and you're unlucky enough to have cloned/pulled between those pushes.)

Anyway, the fix (once again assuming you have not made any local changes or commits!) is:

git merge --abort
git reset --hard origin/trunk

The only other fix is to wipe your local copy and re-clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment