Silently convert UNC paths \\ to // for git

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Obsolete
    • None
    • Component/s: General, Git
    • None
    • Environment:
      Windows7, Embedded Git 1.8.3

      Hi there.

      The root cause for this seems that SourceTree handles it differently. When shared folder path with backslash is entered

      a) as a source path for cloning, SourceTree automatically replaces backslash with slash.
      b) as a source path for a new remote, SourceTree automatically escapes backslash using backslash.

      This different behavior causes all git operation with the added remote to fail, while cloing works just fine.

      Is there any reason for not replacing backslash with slash when adding a remote?

      Thanks.
      Haruo

      SourceTree for Windows 1.0.7
      Embedded Git 1.8.3
      Windows 7 32bit

      How to reproduce:

      1. Navigate through Repository - Repository setting menu - Add
      2. Enter \\fileserver\myhome\myproject as source path
      3. Click OK and close setting window
      4. Fetch from that newly added remote

      and SourceTree gives the following error:

      git -c diff.mnemonicprefix=false -c core.quotepath=false fetch personal
      fatal: '\fileserver\myhome\myproject' does not appear to be a git repository

      fatal: Could not read from remote repository.

      Please make sure you have the correct access rights
      and the repository exists.

      Completed with errors, see above.

      The added section of .git/config file looked like this.

      [remote "personal"]
      url = \\\\fileserver\\myhome
      myproject
      fetch = +refs/heads/:refs/remotes/personal/

      Workaround:

      1. Enter \\\\fileserver\myhome\myproject as source path

      This adds the following section to .git/config file and everything works like a charm.

      [remote "personal"]
      url = \\\\\\\\fileserver\\myhome
      myproject
      fetch = +refs/heads/:refs/remotes/personal/

            Assignee:
            Steve Streeting (Inactive)
            Reporter:
            Haruo Nakayama
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: