Skip to content

Desktop reports changes on symlink files that are not changed #10546

Open

Description

@andersHj

Describe the bug

GitHub Desktop reports changes on files that are not changed. When trying to commit, it fails because there was no changes.
I can discard the changes, but they will re-appear the next time I run a git command. VSCode does not report the file as changed, neither does git status in terminal. The "files" that this happen to are symlinks.

Version & OS

Desktop version: Version 2.5.5. Windows 10 Pro 1909 (OS Build 18363.1016).

Steps to reproduce the behavior

First make sure symlinks are enabled in git and windows (developer mode)
It should then look somthing like this after clone:
image

This works for me to reproduce:

  1. Clone test repo with command: git clone -c core.symlinks=true https://github.com/andersHj/SymlinkTest.git
  2. Add it to GitHub Desktop
    -> GitHub Desktop reports one file has changed, but the file has no changes.
  3. Discard the changes
  4. Type for instance git status in terminal
    -> Changes re-appear
  5. Try to commit changes
    -> Fails with error that there are no changes

Expected behavior

Expected no changes to occur.

Actual behavior

The symlink file appears in the changes tab, but it says it has no changes in the changes preview. And trying to commit fails with no changes error.

Screenshots

github-desktop-bug1

Logs

image

Additional context

Result of git config -l --show-origin from repo root

file:C:/Program Files/Git/etc/gitconfig diff.astextplain.textconv=astextplain
file:C:/Program Files/Git/etc/gitconfig filter.lfs.clean=git-lfs clean -- %f
file:C:/Program Files/Git/etc/gitconfig filter.lfs.smudge=git-lfs smudge -- %f
file:C:/Program Files/Git/etc/gitconfig filter.lfs.process=git-lfs filter-process
file:C:/Program Files/Git/etc/gitconfig filter.lfs.required=true
file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl
file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
file:C:/Program Files/Git/etc/gitconfig core.autocrlf=input
file:C:/Program Files/Git/etc/gitconfig core.fscache=true
file:C:/Program Files/Git/etc/gitconfig core.symlinks=true
file:C:/Program Files/Git/etc/gitconfig pull.rebase=false
file:C:/Program Files/Git/etc/gitconfig credential.helper=manager
file:C:/Users/Anders/.gitconfig user.name=Anders Hjellvik
file:C:/Users/Anders/.gitconfig user.email=......
file:C:/Users/Anders/.gitconfig core.editor='C:/Program Files/Sublime Text 3/sublime_text.exe' -n -w
file:C:/Users/Anders/.gitconfig filter.lfs.process=git-lfs filter-process
file:C:/Users/Anders/.gitconfig filter.lfs.required=true
file:C:/Users/Anders/.gitconfig filter.lfs.clean=git-lfs clean -- %f
file:C:/Users/Anders/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
file:C:/Users/Anders/.gitconfig push.default=current
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=false
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        core.ignorecase=true
file:.git/config        core.symlinks=true
file:.git/config        remote.origin.url=https://github.com/andersHj/SymlinkTest.git
file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config        branch.master.remote=origin
file:.git/config        branch.master.merge=refs/heads/master

Activity

  1. added
    windows
    git
    priority-3
    on Sep 10, 2020
  2. niik commented on Sep 10, 2020

    @niik
    Member

    Hey @andersHj, thanks for opening this. I believe this is due to the version of Git that we currently ship with GitHub Desktop. See https://github.com/git-for-windows/build-extra/blob/master/ReleaseNotes.md#changes-since-git-for-windows-v2262-april-20th-2020

    Due to a bug when handling symbolic links that was fixed in this version, git status will show symbolic links as modified even as git diff won't report any changes. The quickest work-around is to call git add -u which lets Git realize that nothing changed, actually.

    Note that the workaround seems to require the embedded version of Git so you'd have to execute (for the current version of Desktop)

    ~/AppData/Local/GitHubDesktop/app-2.5.5/resources/app/git/mingw64/bin/git.exe add -u
    

    We typically lag a few versions behind Git in order to ensure we're on a stable version. Once Git 2.29 is released we can start looking at upgrading to 2.28.

    I'm sorry I don't have a better answer for you but I hope the workaround unblocks you until we're able to upgrade.

    I'm going to label this as priority 3 for now given that symlinks on Windows isn't a commonly used feature.

  3. andersHj commented on Sep 10, 2020

    @andersHj
    Author

    Hi, thanks for fast reply!

    The workaround did not work for me with git version 2.28.0 installed.

    When running the ~/AppData/Local/GitHubDesktop/app-2.5.5/resources/app/git/mingw64/bin/git.exe add -u command the changes went away, but they re-appeared like before when typing git status in terminal.

    So I downgraded my git version and tried again with git add -u and that worked fine 👍

  4. fabiopedrosa commented on Oct 2, 2020

    @fabiopedrosa

    Workaround worked fine for me.

  5. fabiopedrosa commented on Oct 8, 2020

    @fabiopedrosa

    It actually doesn't after all. Ends up happening over and over.

  6. fabiopedrosa commented on Nov 13, 2020

    @fabiopedrosa

    @niik can someone look into this? still a major hassle.

  7. saschanaz commented on Dec 29, 2020

    @saschanaz
    Contributor

    My workaround is to replace the embedded git executable with the version 2.28 one.

  8. morigs commented on Oct 15, 2021

    @morigs

    I have very similar issue with symlinks in WSL filesystem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gitpriority-3windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions