Home > database >  How do I add a compiled application to the gitignore file?
How do I add a compiled application to the gitignore file?

Time:09-17

I'm trying to upload my copy of Godot to my own github and it complains:

remote: error: File Godot.app/Contents/MacOS/Godot is 156.41 MB; this exceeds GitHub's file size limit of 100.00 MB

Ideally I dont want to upload this file at all.

I tried adding it to the .gitignore file.

I tried adding all kinds of different ways to type the path but none of them worked.

Heres the end of the file:

# Scons progress indicator
.scons_node_count

# ccls cache (https://github.com/MaskRay/ccls)
.ccls-cache/

# compile commands (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
compile_commands.json

# Cppcheck
*.cppcheck

# https://clangd.llvm.org/ cache folder
.clangd/
.cache/

# The Godot app
/Godot.app

CodePudding user response:

The pattern /Godot.app should match your file just fine. However, if the file is already added to the repository, then .gitignore has no effect on it. The .gitignore file affects only files which are untracked.

In your case, your file is in the history, and it needs to be removed from the entire history if you want to upload it to GitHub. You can do a git rebase -i to go back in history to the point at which it was added and remove it from history, or, if it was added in the most recent commit, you can remove it with git rm -r Godot.app and then run git commit --amend.

You could also use git filter-branch or git filter-repo to filter it out from the history.

  • Related