Git推送失败到Windows共享 [英] Git push fail to a Windows share

查看:141
本文介绍了Git推送失败到Windows共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从我的本地存储库推送到位于Windows共享中的远程存储库。

我将重新创建一个简单的场景,其中c是本地硬盘,n是映射的网络驱动器,并向您显示我遇到的错误。

创建本地回购

  user @ PC-W7 / c / More_git 
$ git init
在c:/More_git/.git/


$中初始化了空的Git仓库
$ b

  user @ PC-W7 / n创建远程回购(正如您看到的,它的初始化没有问题)

/git/central.git
$ git --bare init
在n:/git/central.git/
中初始化的空Git仓库

然后我在我的本地仓库中添加一个新的远程控制台,检查它是否真正起作用,添加一个新文件并将其提交给我的本地仓库

  user @ PC-W7 / c / More_git(master)
$ git remote add origin /n/git/central.git

用户@ PC-W7 / c / More_git(主)
$ git remote -v
来源n:/git/central.git(提取)
来源n:/ git / central .git(推送)

user @ PC-W7 / c / More_git(master)
$ git add a.txt

user @ PC-W7 / c / More_git(master)
$ git commit -a -ma.txt added
[master(root-commit)c075576​​] a.txt added
1 file changed,0 insertions(+),0 deletions( - )
创建模式100644 a.txt

此时我准备推送,并且在这里问题来了

  user @ PC-W7 / c / More_git(master)
$ git push origin master
计数对象:3,完成。
写入对象:100%(3/3),207字节| 0字节/秒,完成。
总计3(增量0),重用0(增量0)
远程:错误:无法创建临时文件:文件存在
远程:致命:未能写入对象
错误:解压缩失败:解压缩对象异常退出
到n:/git/central.git
! [remote rejected] master - > master(unpacker error)
错误:无法将某些ref添加到'n:/git/central.git'

如果我执行相同的步骤,但是我推送到硬盘中的本地回购,它可以很好地工作。我一开始以为可能是与预备有关,但是因为我可以创建裸仓库而没有问题..我被卡住了。



任何想法?



谢谢。

编辑:

我在Novell网络下



更新
$ b

  $ git version 
git version 1.8.3.msysgit.0

输出使用GIT_TRACE = 1和完整的UNC路径:

pre $ user @ PC-W7 / c / More_git(master)
$ git remote set-url来源//vshare/DATA/PUBUSER/git/central.git

用户@ PC-W7 / c / More_git(主)
$ git远程-v
原点//vshare/DATA/PUBUSER/git/central.git(获取)
原点//vshare/DATA/PUBUSER/git/central.git(推送)

user @ PC-W7 / c / More_git(master)
$ GIT_TRACE = 1 git push origin master $ b $ trace:built-in:git'push''origin''master'
trace:run_command:'git-receive-pack'\''// vs hare / 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'
计数对象:3,完成。
trace:run_command:'unpack-objects''--pack_header = 2,3'
写入对象:100%(3/3),207字节| 0字节/秒,完成。
合计3(delta 0),重用0(delta 0)
remote:trace:built-in:git'unpack-objects''--pack_header = 2,3'
remote:错误:无法创建临时文件:文件存在
远程:致命:未能写入对象
错误:解压缩失败:解压缩对象异常退出
trace:run_command:'gc'' - auto''--quiet'
trace:built-in:git'gc''--auto''--quiet'
到//vshare/DATA/PUBUSER/git/central.git
! [remote rejected] master - > master(unpacker error)
错误:未能将一些文件推送到'//vshare/DATA/PUBUSER/git/central.git'

我也尝试过使用GIT_TRACE和一个非UNC路径,结果是一样的,我不发布它不会让帖子变长。


<使用映射网络驱动器的IP地址而不是其UNC路径或字母解决了问题。

  git remote set-url origin //ip-address/share/central.git 


I'm trying to push from my local repository to a remote repository located in a windows share.

I'm going to recreate a simple scenario, where c is my local hard disk and n is the mapped network drive, and show you the error that I'm getting.

Creating the local repo

user@PC-W7 /c/More_git
$ git init
Initialized empty Git repository in c:/More_git/.git/

Creating the remote repo (as you see it's initialized without problems)

user@PC-W7 /n/git/central.git
$ git --bare init
Initialized empty Git repository in n:/git/central.git/

Then I add a new remote in my local repo, check that it actually worked, add a new file and commit it to my local 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

At this point I'm ready to push, and here comes the problem

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'

If I do the same steps but instead I push to a local repo in my hard disk, it works perfectly. I thought at first that maybe it has to do with premissions, but since I'm able to create the bare repository without problems.. I'm stuck.

Any ideas?

Thank you.

EDIT:

I'm under a Novell network

UPDATE

$ git version
git version 1.8.3.msysgit.0

And the output using GIT_TRACE=1 and a full UNC path:

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'

I also tried with GIT_TRACE and a non UNC path, the result is the same, I don't post it not to make the post longer.

解决方案

Using the IP address of the mapped network drive instead its UNC path or letter solved the problem.

git remote set-url origin //ip-address/share/central.git

这篇关于Git推送失败到Windows共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆