Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JosephCardwell/320794c47bb5663ddbb7 to your computer and use it in GitHub Desktop.
Save JosephCardwell/320794c47bb5663ddbb7 to your computer and use it in GitHub Desktop.

Revisions

  1. @ferventcoder ferventcoder renamed this gist Dec 16, 2013. 1 changed file with 0 additions and 0 deletions.
  2. @ferventcoder ferventcoder revised this gist Dec 16, 2013. 1 changed file with 11 additions and 9 deletions.
    20 changes: 11 additions & 9 deletions FixSymlinkStatusIssues.ps1
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,16 @@
    #This fixes Permission denied errors you might get when
    # there are git symlinks being used on repositories that
    # you share in both POSIX (usually the host) and Windows (VM).
    # This fixes Permission denied errors you might get when
    # there are git symlinks being used on repositories that
    # you share in both POSIX (usually the host) and Windows (VM).
    #
    #This is not an issue if you are checking out the same
    # repository separately in each platform. This is only an issue
    # when it's the same working set (aka make a change w/out
    # committing on OSX, go to Windows VM and git status would show
    # you that change).
    # This is not an issue if you are checking out the same
    # repository separately in each platform. This is only an issue
    # when it's the same working set (aka make a change w/out
    # committing on OSX, go to Windows VM and git status would show
    # you that change).
    #
    #No warranties, good luck
    # Based on this answer on stack overflow: http://stackoverflow.com/a/5930443/18475
    #
    # No warranties, good luck

    $symlinks = &git ls-files -s | gawk '/120000/{print $4}'
    foreach ($symlink in $symlinks) {
  3. @ferventcoder ferventcoder created this gist Dec 16, 2013.
    17 changes: 17 additions & 0 deletions FixSymlinkStatusIssues.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #This fixes Permission denied errors you might get when
    # there are git symlinks being used on repositories that
    # you share in both POSIX (usually the host) and Windows (VM).
    #
    #This is not an issue if you are checking out the same
    # repository separately in each platform. This is only an issue
    # when it's the same working set (aka make a change w/out
    # committing on OSX, go to Windows VM and git status would show
    # you that change).
    #
    #No warranties, good luck

    $symlinks = &git ls-files -s | gawk '/120000/{print $4}'
    foreach ($symlink in $symlinks) {
    write-host $symlink
    &git update-index --assume-unchanged $symlink
    }