How do I access a git repo on a windows share?

不想你离开。 提交于 2019-11-29 10:53:46

问题


I want to be able to sync a work repo from my Windows 7 desktop to my Windows 7 laptop without pushing my commits to our main server. How do I do this? I can't figure out how to set up a remote path so that git can understand where it is. I generally use Git Bash for dealing with git, not the windows commandline, so the issue here is likely that I can't figure out how to write a path in Git Bash which will reference a windows share.

So, say I have a repo at (windows share path):

\\\\MyWorkPCName\dev\myrepo\

And in the command line, I can access the directories and files (albeit using pushd since cmd is stupid), how do I convert this in to a valid git remote?


回答1:


While Git doesn't recognize backslashes, Windows does recognize forward slashes:

git remote add desktop //MyWorkPCName/dev/myrepo

Git Bash also lets you access windows drives using UNIX-style paths, e.g. C:\Users\bug\repo becomes /c/Users/bug/repo.



来源:https://stackoverflow.com/questions/9104266/how-do-i-access-a-git-repo-on-a-windows-share

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!