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
With the next Git 2.12 (Q1 2017), you should be able to use a path (without having to use the IP address for referencing the server)
See commit 7814fbe (14 Dec 2016) by Johannes Sixt (j6t
).
(Merged by Junio C Hamano -- gitster
-- in commit 4833b7e, 19 Dec 2016)
normalize_path_copy()
: fix pushing to//server/share/dir
on Windows
normalize_path_copy()
is not prepared to keep the double-slash of a//server/share/dir
kind of path, but treats it like a regular POSIX style path and transforms it to/server/share/dir
.The bug manifests when '
git push //server/share/dir master
' is run, becausetmp_objdir_add_as_alternate()
uses the path in normalized form when it registers the quarantine object database vialink_alt_odb_entries()
. Needless to say that the directory cannot be accessed using the wrongly normalized path.Fix it by skipping all of the root part, not just a potential drive prefix.
offset_1st_component
takes care of this, see the implementation incompat/mingw.c
::mingw_offset_1st_component()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With