Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 515
Charles Randall Avatar asked Feb 01 '12 22:02

Charles Randall


1 Answers

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.

like image 117
bug Avatar answered Oct 25 '22 02:10

bug