我正在尝试从我的本地存储库推送到位于Windows共享中的远程存储库.
我将重新创建一个简单的场景,其中c是我的本地硬盘,n是映射的网络驱动器,并向您显示我得到的错误.
创建本地仓库
user@PC-W7 /c/More_git
$ git init
Initialized empty Git repository in c:/More_git/.git/
Run Code Online (Sandbox Code Playgroud)
创建远程仓库(如您所见,它已初始化而没有问题)
user@PC-W7 /n/git/central.git
$ git --bare init
Initialized empty Git repository in n:/git/central.git/
Run Code Online (Sandbox Code Playgroud)
然后我在我的本地仓库中添加一个新的遥控器,检查它是否真的有用,添加一个新文件并将其提交给我当地的repositoy
user@PC-W7 /c/More_git (master)
$ git remote add origin /n/git/central.git
user@PC-W7 /c/More_git (master)
$ git remote -v
origin n:/git/central.git (fetch)
origin n:/git/central.git (push)
user@PC-W7 /c/More_git (master)
$ git add a.txt
user@PC-W7 /c/More_git (master)
$ git commit -a -m "a.txt added"
[master (root-commit) c075576] a.txt added
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a.txt
Run Code Online (Sandbox Code Playgroud)
在这一点上,我已准备好推动,问题出现了
user@PC-W7 /c/More_git (master)
$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 207 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: unable to create temporary file: File exists
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To n:/git/central.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'n:/git/central.git'
Run Code Online (Sandbox Code Playgroud)
如果我执行相同的步骤,而是我推送到我的硬盘中的本地仓库,它的工作完美.我一开始以为可能它与预设有关,但是因为我能够毫无问题地创建裸存储库.我被卡住了.
有任何想法吗?
谢谢.
编辑:
我在Novell网络下
UPDATE
$ git version
git version 1.8.3.msysgit.0
Run Code Online (Sandbox Code Playgroud)
输出使用GIT_TRACE = 1和完整的UNC路径:
user@PC-W7 /c/More_git (master)
$ git remote set-url origin //vshare/DATA/PUBUSER/git/central.git
user@PC-W7 /c/More_git (master)
$ git remote -v
origin //vshare/DATA/PUBUSER/git/central.git (fetch)
origin //vshare/DATA/PUBUSER/git/central.git (push)
user@PC-W7 /c/More_git (master)
$ GIT_TRACE=1 git push origin master
trace: built-in: git 'push' 'origin' 'master'
trace: run_command: 'git-receive-pack '\''//vshare/DATA/PUBUSER/git/central.git'\'''
trace: built-in: git 'receive-pack' '//vshare/DATA/PUBUSER/git/central.git'
trace: run_command: 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
trace: built-in: git 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
Counting objects: 3, done.
trace: run_command: 'unpack-objects' '--pack_header=2,3'
Writing objects: 100% (3/3), 207 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: trace: built-in: git 'unpack-objects' '--pack_header=2,3'
remote: error: unable to create temporary file: File exists
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
trace: run_command: 'gc' '--auto' '--quiet'
trace: built-in: git 'gc' '--auto' '--quiet'
To //vshare/DATA/PUBUSER/git/central.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '//vshare/DATA/PUBUSER/git/central.git'
Run Code Online (Sandbox Code Playgroud)
我也试过GIT_TRACE和非UNC路径,结果是一样的,我不发布它不会让帖子更长.
使用映射网络驱动器的 IP 地址而不是其 UNC 路径或字母解决了该问题。
git remote set-url origin //ip-address/share/central.git
Run Code Online (Sandbox Code Playgroud)