{"record":{"id":"46a0ad10b6211bb4","repo":"gitbutlerapp/gitbutler","slug":"using-git-across-a-network-is-not-recommended-eit","errorCode":null,"errorMessage":"Using git across a network is not recommended. Either clone the repo locally, or use the NET USE command to map a network drive.","messagePattern":"Using git across a network is not recommended\\. Either clone the repo locally, or use the NET USE command to map a network drive\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"apps/desktop/src/lib/project/projectsService.ts","lineNumber":190,"sourceCode":"\t\tif (/^\\\\\\\\wsl.localhost/i.test(path)) {\n\t\t\tconst message =\n\t\t\t\t\"For WSL2 projects, install the Linux version of GitButler inside of your WSL2 distro.\";\n\t\t\tconsole.warn(message);\n\t\t\tshowToast({\n\t\t\t\tstyle: \"info\",\n\t\t\t\ttitle: \"Use the Linux version of GitButler\",\n\t\t\t\tmessage,\n\t\t\t});\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif (/^\\\\\\\\/i.test(path)) {\n\t\t\tconst message =\n\t\t\t\t\"Using git across a network is not recommended. Either clone \" +\n\t\t\t\t\"the repo locally, or use the NET USE command to map a \" +\n\t\t\t\t\"network drive.\";\n\t\t\tconsole.warn(message);\n\t\t\tshowToast({\n\t\t\t\tstyle: \"info\",\n\t\t\t\ttitle: \"UNC paths are not directly supported\",\n\t\t\t\tmessage,\n\t\t\t});\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tgetLastOpenedProject() {\n\t\treturn get(this.persistedId);\n\t}\n\n\tsetLastOpenedProject(projectId: string) {\n\t\tthis.persistedId.set(projectId);","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/apps/desktop/src/lib/project/projectsService.ts#L172-L208","documentation":"validateProjectPath in projectsService detects a generic UNC network path (a path starting with \\\\\\\\) and shows an info toast explaining that git over a network share is unsupported/unreliable, recommending a local clone or a mapped network drive (NET USE). It is a pre-emptive advisory, not a hard failure.","triggerScenarios":"Calling validateProjectPath (via getValidPath) with a UNC path like \\\\\\\\fileserver\\\\share\\\\repo that does not match the more specific wsl.localhost rule (checked earlier).","commonSituations":"Corporate environments keeping repos on SMB shares; users adding projects straight from a NAS; paths pasted from Explorer's address bar for network locations.","solutions":["Clone the repository to a local drive and add the local clone to GitButler.","If the repo must stay on the share, map it to a drive letter first (e.g. `net use Z: \\\\\\\\fileserver\\\\share`) and add Z:\\\\path\\\\repo.","Use a version-control workflow (push/pull) instead of pointing git directly at the network share."],"exampleFix":"// before\naddProject(\"\\\\\\\\nas\\\\repos\\\\my-app\")\n// after\n$ net use Z: \\\\\\\\nas\\\\repos\naddProject(\"Z:\\\\my-app\")   // or clone locally first","handlingStrategy":"validation","validationCode":"function isUncPath(path: string): boolean {\n  return /^\\\\\\\\/i.test(path); // matches both \\\\server\\share and \\\\wsl.localhost\n}\nif (isUncPath(candidatePath)) {\n  // prompt: clone locally or map a drive letter (NET USE) first\n}","typeGuard":"const isUnc = (p: string): p is `\\\\\\\\${string}` => /^\\\\\\\\/i.test(p);","tryCatchPattern":null,"preventionTips":["Keep working repositories on local disks; use push/pull to sync with shares.","If a share is unavoidable, map it to a drive letter and use the mapped path.","Standardize local clone locations (e.g. C:\\dev) in team docs to avoid UNC paths."],"tags":["unc-path","windows","network","project-validation"],"backgroundTag":"unsupported-platform","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}