GitHub Desktop: "This file is empty"

13,452

Solution 1

After discussion, if the change of the tex file is only in term of metadata (and not actual file content change, after a latex recompilation), the GitHub Desktop might be unable to display any change.

Since it detects no change even though the git status list this file, it falls back to a "this file is empty" message.

Solution 2

In addition to the @VonC response.

To dissmiss this alert

Git desktop

  1. unselect all changed files

  2. select only the "this file is empty" files

  3. try to commit

  4. Git will display a commit error, saying that you can't do that. After closing the modal, Git should delete the files from the changes list.

Share:
13,452
Franck Dernoncourt
Author by

Franck Dernoncourt

Updated on June 05, 2022

Comments

  • Franck Dernoncourt
    Franck Dernoncourt almost 2 years

    The file naaclhlt2016.tex is not empty on the client or in the repository, however GitHub Desktop displays "This file is empty". What could explain this?

    enter image description here

    The file naaclhlt2016.tex is present on GitHub repository:

    enter image description here

    git status:

    enter image description here

    It creates conflict when I try to sync:

    enter image description here

    • VonC
      VonC over 8 years
      Is this a new file, not yet pushed?
    • Franck Dernoncourt
      Franck Dernoncourt over 8 years
      @VonC The file naaclhlt2016.tex is present on GitHub repository.
    • VonC
      VonC over 8 years
      Is it present in a different path? Is there any case difference anywhere in the path or name?
    • Franck Dernoncourt
      Franck Dernoncourt over 8 years
      @VonC same path, same case.
    • VonC
      VonC over 8 years
      What does a git status says, when using the command line?
    • Franck Dernoncourt
      Franck Dernoncourt over 8 years
      @VonC git status thinks naaclhlt2016.tex has changed. I added the screenshot in the question. It looks like naaclhlt2016.tex appears in the list of changed files each time I compile the latex document.
    • VonC
      VonC over 8 years
      If that document is generated, maybe it should not be versioned at all.
    • Franck Dernoncourt
      Franck Dernoncourt over 8 years
      @VonC True, but compiling it shouldn't change it. Looking at the "date modified", you are right though. I guess that explains it.
    • VonC
      VonC over 8 years
      That explains the modified status, but not "file is empty", unless GitHub Desktop is unable to display metadata changes, and consider it does not detect any file content change?
    • Franck Dernoncourt
      Franck Dernoncourt over 8 years
      @VonC I guess GitHub Desktop is unable to display metadata changes.
  • VonC
    VonC over 8 years
    That might be a bug or at least a surprising "feature" to report to GitHub support, and see if they think it is the expected response.
  • Franck Dernoncourt
    Franck Dernoncourt over 8 years
    I will report, but first I will try to understand why compiling a tex file with Texmaker changes the “date modified” meta-information. I will let you know when I submit the report.
  • VonC
    VonC over 7 years
    @FranckDernoncourt Did you get any feedback from gitHub support about this feature?
  • Franck Dernoncourt
    Franck Dernoncourt over 7 years
    Sorry, I forgot whether I had submitted a report. I have just submitted one. Thanks for the follow-up.
  • Franck Dernoncourt
    Franck Dernoncourt over 7 years
    "That may not be the intended behavior, but I am not sure. I have shared your feedback with our team for them to consider."
  • VonC
    VonC over 7 years
    @FranckDernoncourt the suspense is killing me ;)
  • Varaquilex
    Varaquilex over 7 years
    Any news on this?
  • VonC
    VonC over 7 years
    @Varaquilex not on my side. Maybe the OP has more.
  • Shai Petel
    Shai Petel about 6 years
    I'd say this is the "solution" to this strange issue. Indeed trying to commit only these files results in an error, the commit is not done and the problem is gone. Thanks!