Search code examples
gitgoogle-docs

Git is newly refusing to track .gdoc files


Windows 10, using git 2.30.0.windows.2 and git bash.

I have been tracking changes in a repository that is also a Google Drive folder because despite the many many problems this can cause, it was the only way to get my code onto my school's cluster and also satisfy my non-git labmates' need for synching. Previously, git was tracking .gdoc files in my repository just fine, but about three weeks ago git started giving me the below error.

$ git add -A
error: Notes/Conservation Designations.gdoc: failed to insert into database
error: unable to index file 'Notes/Conservation Designations.gdoc'
fatal: updating files failed

Furthermore, in git status, some files showed up both as deleted and as untracked. At first I just thought it was the gdoc files but upon reflection, this actually happened to many files, but non-gdoc files can be staged. When I run git add -A --ignore-errors; git status, this is the output. In the changes to be committed section, you can see that there are several .gdoc files listed as deleted, and then those files are also listed as untracked at the end of the git status output.

On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    .DS_Store
        modified:   .Rhistory
        deleted:    ".Rproj.user/1E6F1906/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/ctx/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/explorer-cache/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/pcs/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/presentation/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/profiles-cache/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/sources/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/sources/per/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/sources/per/t/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/sources/per/u/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/sources/prop/Icon\r"
        deleted:    ".Rproj.user/1E6F1906/viewer-cache/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/ctx/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/presentation/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/profiles-cache/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/sources/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/sources/per/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/sources/prop/Icon\r"
        deleted:    ".Rproj.user/AAD91AAF/viewer-cache/Icon\r"
        deleted:    ".Rproj.user/Icon\r"
        deleted:    ".Rproj.user/shared/Icon\r"
        deleted:    ".Rproj.user/shared/notebooks/Icon\r"
        modified:   .Rproj.user/shared/notebooks/paths
        deleted:    ".dvc/Icon\r"
        new file:   .dvc/desktop.ini
        deleted:    ".dvc/plots/Icon\r"
        new file:   .dvc/plots/desktop.ini
        modified:   .gitignore
        deleted:    Data.dvc
        deleted:    "Figures (1)/Icon\r"
        deleted:    "Icon\r"
        deleted:    "Manuscript/Icon\r"
        new file:   Manuscript/desktop.ini
        deleted:    Notes/Analysis AK 10_15_20.gdoc
        deleted:    Notes/Analysis AK 10_21_20.gdoc
        deleted:    Notes/Analysis AK 10_8_20.gdoc
        deleted:    Notes/Analysis AK 12_1_20.gdoc
        deleted:    Notes/Annotated Bibliography.gdoc
        deleted:    "Notes/CornellLabDocs/Icon\r"
        new file:   Notes/CornellLabDocs/desktop.ini
        deleted:    "Notes/Icon\r"
        deleted:    "Notes/Meeting agendas/Icon\r"
        new file:   Notes/Meeting agendas/desktop.ini
        modified:   Notes/PredictorsTest.xlsx
        deleted:    Notes/Preliminary Analyses 8_12_20-9_4_20.gdoc
        deleted:    Notes/Preliminary analysis 9_24_20.gdoc
        deleted:    "Notes/analysis-katie_files (1)/Icon\r"
        new file:   Notes/analysis-katie_files (1)/desktop.ini
        deleted:    "Notes/analysis-katie_files (1)/figure-html/Icon\r"
        new file:   Notes/analysis-katie_files (1)/figure-html/desktop.ini
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-2-1.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-2-2.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-2-3.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-2-4.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-2-5.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-3-1.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-3-2.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-3-3.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-3-4.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-3-5.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-4-1.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-4-2.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-4-3.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-4-4.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-4-5.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-5-1.png
        modified:   Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-5-2.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-5-3.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-5-4.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-5-5.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-6-1.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-6-2.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-6-3.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-6-4.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-6-5.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-7-1.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-7-2.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-7-3.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-7-4.png
        deleted:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-7-5.png
        new file:   Notes/analysis-katie_files (2)/desktop.ini
        new file:   Notes/analysis-katie_files (2)/figure-html/desktop.ini
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-2-1.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-2-2.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-3-1.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-3-2.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-4-1.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-4-2.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-5-1.png
        new file:   Notes/analysis-katie_files (2)/figure-html/unnamed-chunk-5-2.png
        new file:   Notes/analysis-katie_files (3)/desktop.ini
        new file:   Notes/analysis-katie_files (3)/figure-html/desktop.ini
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-2-1.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-2-2.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-3-1.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-3-2.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-4-1.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-4-2.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-5-1.png
        new file:   Notes/analysis-katie_files (3)/figure-html/unnamed-chunk-5-2.png
        deleted:    "Notes/analysis-katie_files/Icon\r"
        new file:   Notes/analysis-katie_files/desktop.ini
        deleted:    "Notes/analysis-katie_files/figure-html/Icon\r"
        new file:   Notes/analysis-katie_files/figure-html/desktop.ini
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-10-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-10-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-10-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-10-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-10-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-10-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-10-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-10-4.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-11-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-11-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-11-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-11-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-11-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-11-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-11-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-11-4.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-11-5.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-11-5.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-12-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-12-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-12-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-12-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-12-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-12-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-12-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-12-4.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-12-5.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-12-5.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-13-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-13-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-13-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-13-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-13-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-13-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-13-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-13-4.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-14-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-14-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-14-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-14-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-14-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-14-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-14-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-14-4.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-8-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-8-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-8-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-8-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-8-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-8-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-8-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-8-4.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-8-5.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-8-5.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-9-1.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-9-1.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-9-2.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-9-2.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-9-3.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-9-3.png
        renamed:    Notes/analysis-katie_files (1)/figure-html/unnamed-chunk-9-4.png -> Notes/analysis-katie_files/figure-html/unnamed-chunk-9-4.png
        new file:   Notes/desktop.ini
        modified:   Notes/substrate-exploration.Rmd
        modified:   Notes/substrate-exploration.html
        modified:   Notes/substrate-exploration_cache.dvc
        deleted:    "Notes/substrate-exploration_files/Icon\r"
        new file:   Notes/substrate-exploration_files/desktop.ini
        deleted:    "Notes/substrate-exploration_files/figure-html/Icon\r"
        new file:   Notes/substrate-exploration_files/figure-html/desktop.ini
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-5-1.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-5-2.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-5-3.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-5-4.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-6-1.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-6-2.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-6-3.png
        new file:   Notes/substrate-exploration_files/figure-html/unnamed-chunk-6-4.png
        renamed:    Papers/7_10 assigned papers for Katie, Tom, and Keese/Bradbury et al. - 2003 - Habitat and weather are weak correlates of nestlin.pdf -> Papers/7 10 assigned papers for Katie, Tom, and Keese/Bradbury et al. - 2003 - Habitat and weather are weak correlates of nestlin.pdf
        renamed:    Papers/7_10 assigned papers for Katie, Tom, and Keese/Cox et al. - 2020 - Population decline in tree swallows (Tachycineta b.pdf -> Papers/7 10 assigned papers for Katie, Tom, and Keese/Cox et al. - 2020 - Population decline in tree swallows (Tachycineta b.pdf
        renamed:    Papers/7_10 assigned papers for Katie, Tom, and Keese/Marcelino et al. - 2020 - Extreme events are more likely to affect the breed.pdf -> Papers/7 10 assigned papers for Katie, Tom, and Keese/Marcelino et al. - 2020 - Extreme events are more likely to affect the breed.pdf
        renamed:    Papers/7_10 assigned papers for Katie, Tom, and Keese/Miller et al. - 2017 - Multi-state, multi-stage modeling of nest-success .pdf -> Papers/7 10 assigned papers for Katie, Tom, and Keese/Miller et al. - 2017 - Multi-state, multi-stage modeling of nest-success .pdf
        renamed:    Papers/7_10 assigned papers for Katie, Tom, and Keese/Parmesan et al. - 2013 - Beyond climate change attribution in conservation .pdf -> Papers/7 10 assigned papers for Katie, Tom, and Keese/Parmesan et al. - 2013 - Beyond climate change attribution in conservation .pdf
        renamed:    Papers/7_10 assigned papers for Katie, Tom, and Keese/Weegman et al. - 2017 - Integrated population models reveal local weather .pdf -> Papers/7 10 assigned papers for Katie, Tom, and Keese/Weegman et al. - 2017 - Integrated population models reveal local weather .pdf
        new file:   Papers/7 10 assigned papers for Katie, Tom, and Keese/desktop.ini
        deleted:    "Papers/7_10 assigned papers for Katie, Tom, and Keese/Icon\r"
        deleted:    "Papers/AK lit review/Icon\r"
        new file:   Papers/AK lit review/desktop.ini
        new file:   Papers/All papers/Borgmann et al. (2004).pdf
        new file:   Papers/All papers/Both et al. (2004).pdf
        new file:   Papers/All papers/Bradury et al. (2003).pdf
        new file:   Papers/All papers/Chafoun et al. (2002).pdf
        new file:   Papers/All papers/Conrey et al. (2016).pdf
        new file:   Papers/All papers/Cox et al. (2013).pdf
        new file:   Papers/All papers/Cox et al. (2019).pdf
        new file:   Papers/All papers/Cox et al. (2020).pdf
        new file:   Papers/All papers/Dawson et al. (2005).pdf
        new file:   Papers/All papers/Deng et al. (2005).pdf
        new file:   "Papers/All papers/D\342\200\231Odorico et al. (2013).pdf"
        new file:   "Papers/All papers/Ghilain and B\303\251lisleet et al. (2008).pdf"
        new file:   Papers/All papers/Hartley et al. (1998).pdf
        new file:   Papers/All papers/Imlay et al. (2018).pdf
        new file:   Papers/All papers/Latimer and Zuckerberg et al. (2017).pdf
        new file:   Papers/All papers/Leston et al. (2006).pdf
        new file:   Papers/All papers/Marcelino et al. (2020).pdf
        new file:   Papers/All papers/Mccreedy et al. (2015).pdf
        new file:   Papers/All papers/Miller et al. (2017).pdf
        new file:   Papers/All papers/Parmesan et al. (2013).pdf
        new file:   Papers/All papers/Rodewald (2002).pdf
        new file:   Papers/All papers/Rodewald et al. (2001).pdf
        new file:   Papers/All papers/Rodewald et al. (2011).pdf
        new file:   Papers/All papers/Ryder et al. 2010.pdf
        new file:   Papers/All papers/Scheffers et al. (2013).pdf
        new file:   Papers/All papers/Socolar et al. (2017).pdf
        new file:   Papers/All papers/Suggitt et al. (2011).pdf
        new file:   Papers/All papers/Weegman et al. (2017).pdf
        new file:   Papers/All papers/Winkler et al. (2013).pdf
        new file:   Papers/All papers/Wright et al. (2010).pdf
        new file:   Papers/All papers/Zuckerberg et al. (2018).pdf
        new file:   Papers/All papers/desktop.ini
        deleted:    "Papers/ClimateLandUse/Icon\r"
        new file:   Papers/ClimateLandUse/desktop.ini
        deleted:    "Papers/Icon\r"
        deleted:    "Papers/KSL lit review/Icon\r"
        new file:   Papers/KSL lit review/desktop.ini
        deleted:    "Papers/NestwatchStudies/Icon\r"
        new file:   Papers/NestwatchStudies/desktop.ini
        deleted:    "Papers/Tom and Kees Lit Review/Icon\r"
        new file:   Papers/Tom and Kees Lit Review/desktop.ini
        deleted:    "Papers/Urban_Rural_Studies/Icon\r"
        new file:   Papers/Urban_Rural_Studies/desktop.ini
        new file:   Papers/desktop.ini
        deleted:    RAW.dvc
        new file:   desktop.ini
        renamed:    Figures (1)/HistLaydates.png -> figures/HistLaydates.png
        deleted:    "figures/Icon\r"
        renamed:    Figures (1)/MapLaydate.png -> figures/MapLaydate.png
        new file:   figures/desktop.ini
        deleted:    "slurm_log/Icon\r"

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   Notes/Conservation Designations.gdoc
        modified:   Notes/Data exploration.gdoc
        modified:   Notes/Declining North American Bird Species.gdoc
        modified:   Notes/GitHub tutorial.gdoc
        modified:   Notes/Meeting agendas/2020-07-31.gdoc
        modified:   Notes/Meeting agendas/2020-08-07.gdoc
        modified:   Notes/Meeting agendas/2020-08-14 (1).gdoc
        modified:   Notes/Meeting agendas/2020-08-14.gdoc
        modified:   Notes/Meeting agendas/2020-09-11.gdoc
        modified:   Notes/Meeting agendas/2020-09-18.gdoc
        modified:   Notes/Meeting agendas/2020-09-25.gdoc
        modified:   Notes/Meeting agendas/2020-10-02.gdoc
        modified:   Notes/Meeting agendas/2020-10-09.gdoc
        modified:   Notes/Meeting agendas/2020-10-16.gdoc
        modified:   Notes/Meeting agendas/2020-10-23.gdoc
        modified:   Notes/Meeting agendas/2020-10-30.gdoc
        modified:   Notes/Meeting agendas/2020-11-12.gdoc
        modified:   Notes/Meeting agendas/2020-11-20.gdoc
        modified:   Notes/Meeting agendas/2020-11-6.gdoc
        modified:   Notes/Meeting agendas/2020-12-11.gdoc
        modified:   Notes/Meeting agendas/2020-12-18.gdoc
        modified:   Notes/Meeting agendas/2020-7-10.gdoc
        modified:   Notes/Meeting agendas/2020-7-17.gdoc
        modified:   Notes/Meeting agendas/2020-7-24.gdoc
        modified:   Notes/Meeting agendas/2020-7-3.gdoc
        modified:   Notes/Meeting agendas/2020-8-28.gdoc
        modified:   Notes/Meeting agendas/2020-9-4.gdoc
        modified:   Notes/Model Formulation.gdoc
        modified:   Notes/Models (Kees and Tom).gdoc
        modified:   Papers/AK lit review/AK Lit review.gdoc
        modified:   Papers/Climate variables.gsheet
        modified:   Papers/Lit Review Spreadsheet.gsheet
        modified:   Papers/Tom and Kees Lit Review/Kees Tom Lit Review.gdoc
        modified:   Papers/Urban_Rural_Studies/Ryder_etal_2010_EcolApps.gdoc

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Notes/Analysis AK 10 15 20.gdoc
        Notes/Analysis AK 10 21 20.gdoc
        Notes/Analysis AK 10 8 20.gdoc
        Notes/Analysis AK 12 1 20.gdoc
        Notes/Meeting agendas/2020-1-14.gdoc
        Notes/Preliminary Analyses 8 12 20-9 4 20.gdoc
        Notes/Preliminary analysis 9 24 20.gdoc
        Papers/Annotated Bibliography.gdoc

Did Google change the way their files are encoded and git hasn't been updated to handle them? Has anyone else experienced anything like this? I have turned up nothing in a couple of weeks of Googling and tearing my hair out.

Things I have tried: Updating git. Dual booting my Windows with Linux so that there's no emulator faffery. Making a separate folder and repository, adding a single .gdoc file, initializing a new repository, and then trying to git add (same error). Running git bash as an admin. Using sudo on a Mac.


Solution

  • Git is designed to support arbitrary files; that is, theoretically, any sequence of bytes can be used. No special encoding or format is required.

    The reason you're seeing this message is because for some reason Git is unable to write the file into the repository. This could be caused by permissions problems or by the fact that Google Drive does not expose a POSIX-compliant file system. I suspect it is the latter; other file systems that are clearly not POSIX compliant, such as DAV mounts, also frequently experience problems.

    I strongly advise you not to store Git repositories in a cloud storage folder unless you don't care about your data. If you must do so, when the repository is quiescent, tar (not zip) the repository up into a tarball and store the tarball in the cloud storage folder instead. Don't use any network file system of any sort for a Git repository other than SSHFS (that is, SFTP) or NFSv4 unless you are certain it is POSIX compliant, since Git requires POSIX semantics for data integrity.

    Note that many of your files somehow have a trailing carriage return on the end, which is causing many files to differ only in that name. Likely that is also caused by Google Drive. While the carriage return is valid in Unix filenames, it is uncommon and bizarre (and not portable to Windows), and you're advised not to use it.

    To fix this, copy the entire repository onto a POSIX-compliant file system (e.g., ext4) and try again. If necessary, you can use sudo to chown the files to your user and group (although this should not be necessary) and use chmod -R u+rw . to make sure all files and directories are writable. If things still don't work, you can see if any directories have missing executable bits with find . -type d ! -perm -100 and then add the executable bit. That should fix your repository and make it work.