Git push error due to unknown file

Asked 2 years ago, Updated 2 years ago, 56 views

We are developing with Swift and Xcode.
I try to git push to GitHub for version control, but it doesn't work.

The following command results in an error:

cd "/Users/gncc/Documents/TestAppMain/TestApp"
git add.
git commit-m "first commit"
git remote add origin https://github.com/gncc/TestApp.git
git push-u origin main

The error message is similar to the following:

 remote:error:Trace:xxxxxxxxxx
remote:error:See http://git.io/iEPt8g for more information.
remote:error:TestApp/Test.framework/TestFramework is 475.69 MB; this exceeds GitHub's file size limit of 100.00 MB
remote:error:GH001:Large files detected.You may want to try Git Large File Storage -https://git-lfs.github.com.
To https://github.com/gncc/TestApp.git
 ! [remote rejected] main->main (pre-receive hook decremented)

I think the error is Git lfs because TestApp/Test.framework/TestFramework file size is too large. After deleting each folder in TestApp/Test.framework/TestFramework, the same error appears as git add and git code.

gitlfs has been installed, and the large folder of the files is covered by gitlfs as follows:

cd "/Users/gncc/Documents/TestAppMain/TestApp"
git lfs track "/**"
git add.gitattributes

"When I view hidden folders and files on my Mac with ""command+shift+."", it seems that the files are not hidden."

How can I delete or push the file directly to GitHub without deleting it?

git github

2022-09-30 10:28

1 Answers

Re-add Test.framework under the TestApp directory and

cd TestApp
gitrm-fr Test.framework

Please commit after
This command removes test.framework that is already under git administration from git.

I think git push will succeed.
Next, Test.framework would like to be added to the project but not managed by git
In the .gitignore file

Test.framework/

Then commit the .gitignore file.
If you have a .gitignore file, add one line to it, or create a .gitignore file in the same hierarchy as the .git folder and write the above in it.


2022-09-30 10:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.