Git push fail to a Windows share

前端 未结 4 1738
情歌与酒
情歌与酒 2021-01-05 10:38

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 d

4条回答
  •  生来不讨喜
    2021-01-05 11:20

    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, because tmp_objdir_add_as_alternate() uses the path in normalized form when it registers the quarantine object database via link_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 in compat/mingw.c::mingw_offset_1st_component().

提交回复
热议问题