Skip to content

git config overwrites symbolic links #958

Closed
@rpaquay

Description

@rpaquay
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.9.2.windows.1
sizeof-long: 4
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.10586]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
> type "C:\Program Files\Git\etc\install-options.txt"
Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

n/a

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Cmd ("As Administrator")

(Run cmd.exe "As Administrator" to allow symbolic link creation)
> git init
> copy .git\config git.config
> del .git\config
> mklink .git\config ..\git.config
> dir .git\config
> git config core.filemode false --replace-all
> dir .git\config
  • What did you expect to occur after running these commands?

The last dir .git\config command shows that the file is a SYMLINK:

11/15/2016  11:22 AM    <SYMLINK>      config [..\git.config]
  • What actually happened instead?

The last dir .git\config command shows that the SYMLINK has been replaced by a file:

11/15/2016  11:22 AM               148 config
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

The problem is not specific to a particular repository. Even though the example seems trivial, the issue is actually affecting "real-world" examples, specifically people using the https://code.google.com/p/git-repo/ tool to handle multiple repository. The git-repo tool create many symblic links in ".git" directories, and it does not expect these symbolic links to be replaced by regular files.

Note that git for cygwin preserves symlinks with a similar set of commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions