Home > front end >  Ignore folder on already commited, but unable to upload, git repository
Ignore folder on already commited, but unable to upload, git repository

Time:06-27

I am not sure how to solve my little "noobish" problem within git without deleting any progress.

I just realized that the last 4 commits haven't been pushed from local to remote. Furthermore, I am quite sure, that the reason are the big ML-model-files (several GBs).

I understand that it's not the purpose of git to backup/historize those kinds of files. I created i a .gitignore on root to ignore the folder with the models. But this is just applying on the newest commit... which still is not working as the old commits (with the model files are being pushed and end with an error...)

I am using the git within Pycharm.

Git Pycharm, Log

Optimal outcome would be:

  • Keeping the commits as they are, but excluding the models folder.

Thank you for your suggestions and support.

Cheers Dave

CodePudding user response:

Not sure why the way via: BFG didn't worked out for me. I mirrored the local repo. Within the local repo a Git.git folder was created. used java -jar bfg.jar --delete-folders Models /home/dave/Dokumente/MAS/Project/Git/Git.git BFG generats some output, in the output all files in /Models were marked as "DELTED", what was my goal, then used git reflog expire --expire=now --all && git gc --prune=now --aggressive to got those changes on my local repo. After that git push to my remote repo. ... was then still trying to upload all the models, even if they wehre marked as deleted, not sure where I made an error, also tried the java command with --no-blob-protection ...

My solution was as follows:

  1. Manually moved the /Models path to another location (local)
  2. Amended the last commit (only a few small files) inkl. .gitignore /~/Models
  3. Pushed all changes (which this time worked...)
  4. Moved back /Model path into the local git path

As the /Model path is now on the ignore list, it should give me any trouble.

Cheers Dave

  •  Tags:  
  • git
  • Related