{"thread":{"id":"9115","subject":"Git doesn't like symlinks?","startedAt":"2007-07-20T11:19:07Z","lastAt":"2007-08-08T08:29:57Z","messageCount":2,"participants":["Rogan Dawes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47957","messageId":"46A09A2B.3030205@dawes.za.net","threadId":"9115","inReplyTo":null,"subject":"Git doesn't like symlinks?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-07-20T11:19:07Z","receivedAt":"2007-07-20T11:19:07Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Hi folks,\n\nI have been tasked with doing some development against an external SVN \nrepo, and keeping it largely in sync with an internal directory.\n\nSeeing as how this is a git list, I obviously decided to do this using \ngit :-)\n\nSo, I have a local git repo with my local changes from the SVN repo, and \nI can push them to the SVN repo without too many problems. The problem \narises when I try to sync with the local directory.\n\nSince the local directory's structure doesn't match the repo exactly, I \nfigured I could work around that by using a symlink to get to the right \nplace.\n\nie. the local dir is\nC:\\local\\blah\\release\\5.2\\<contents>\n\nand the structure of the SVN (and hence git) repo is:\n/top/main/<contents>\n\nwhere <contents> is/should be identical between the two places.\n\nObviously, git won't work correctly in the local dir, so I tried the \nfollowing (on Cygwin)\n\n$ cd /tmp\n$ ~/git/contrib/workdir/git-new-workdir /my/git/repo/ repo-local\n$ cd repo-local/top\n$ rm -rf main/\n$ ln -s /c/local/blah/release/5.2/ main/\n$ git status\n\nThis worked, and showed me that there were a few files out of sync.\n\nI decided to copy over one of the files from git to the local dir:\n\n$ git checkout top/main/some/file\n\nAnd git deleted my \"main\" symlink, and replaced it with a real dir, \ncontaining \"some/file\".\n\nEverything _else_ was now \"missing\".\n\nAny ideas on how I can get this to work? I know this is not strictly \nwhat git was designed for, but it could do a really good job if it would \nonly leave my symlink alone.\n\nRogan\n"},{"id":"50177","messageId":"46B97F05.6060503@dawes.za.net","threadId":"9115","inReplyTo":"46A09A2B.3030205@dawes.za.net","subject":"Re: Git doesn't like symlinks?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-08-08T08:29:57Z","receivedAt":"2007-08-08T08:29:57Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Rogan Dawes wrote:\n> Hi folks,\n> \n> I have been tasked with doing some development against an external SVN \n> repo, and keeping it largely in sync with an internal directory.\n> \n> Seeing as how this is a git list, I obviously decided to do this using \n> git :-)\n> \n> So, I have a local git repo with my local changes from the SVN repo, and \n> I can push them to the SVN repo without too many problems. The problem \n> arises when I try to sync with the local directory.\n> \n> Since the local directory's structure doesn't match the repo exactly, I \n> figured I could work around that by using a symlink to get to the right \n> place.\n> \n> ie. the local dir is\n> C:\\local\\blah\\release\\5.2\\<contents>\n> \n> and the structure of the SVN (and hence git) repo is:\n> /top/main/<contents>\n> \n> where <contents> is/should be identical between the two places.\n> \n> Obviously, git won't work correctly in the local dir, so I tried the \n> following (on Cygwin)\n> \n> $ cd /tmp\n> $ ~/git/contrib/workdir/git-new-workdir /my/git/repo/ repo-local\n> $ cd repo-local/top\n> $ rm -rf main/\n> $ ln -s /c/local/blah/release/5.2/ main/\n> $ git status\n> \n> This worked, and showed me that there were a few files out of sync.\n> \n> I decided to copy over one of the files from git to the local dir:\n> \n> $ git checkout top/main/some/file\n> \n> And git deleted my \"main\" symlink, and replaced it with a real dir, \n> containing \"some/file\".\n> \n> Everything _else_ was now \"missing\".\n> \n> Any ideas on how I can get this to work? I know this is not strictly \n> what git was designed for, but it could do a really good job if it would \n> only leave my symlink alone.\n> \n> Rogan\n\nSo, for anyone else caught in this awkward position, the answer is not \nto use a symlink, but to use cygwin's mount command instead.\n\n$ cd /tmp\n$ ~/git/contrib/workdir/git-new-workdir /my/git/repo/ repo-local\n$ cd repo-local/top\n$ rm -rf main/\n$ mkdir main/\n$ mount 'C:\\local\\blah\\release\\5.2\\' /tmp/repo-local/top/main/\n\nAnd everything works as expected.\n\nRegards,\n\nRogan\n"}]}