A while ago I accidentally added some large data files to a git repo folder on my desktop without putting the file names in the .gitignore file. Since then I made lots of changes to the files in my git repository on my desktop without pushing them to origin. Now I finally want to sync my local branch and the main branch, but I cannot.
My solution to this was to go to my github branch on the github website and then manually delete every file from origin so that I could cleanly push everything. I added the data file names into my .gitignore file, but I cannot push anything. It tries to send gigabytes of data and then eventually crashes.
As a test, I put every file name on my desktop into the .gitignore file then tried to push. In theory this would sync an empty repository with another empty repository so there should be no file transferring or reading and writing. However, git push still tries to transfer hundreds of megabytes of information to the main repository. Here is a snapshot of what I mean:
jbryaniv@Js-MacBook-Air-3 Past % git push -f
Enumerating objects: 1078, done.
Counting objects: 100% (1048/1048), done.
Delta compression using up to 8 threads
Compressing objects: 100% (995/995), done.
Writing objects: 55% (558/1010), 765.57 MiB | 1.37 MiB/s
What is causing this massive slowdown to my git writing process even though there are no files to write?