[Swift5] What to do if you want to commit files to github but there are too many

Development environment

Swift5 xcode12.2 This is a problem that occurred while creating a project named EngineerApp.

error

スクショ.png As you can see, when you try to commit a file to git, if there are too many files, you cannot commit. the working copy “EngineerApp” failed to commit files. Message appears and the commit fails.

Cause

When I added a file such as an image to the project, I accidentally included other files as well. In my case, all the data in the download folder on my Mac was included.

Workaround

In the terminal run the following to close the terminal, restart the project and commit again

cd EngineerApp
/Applications/Xcode.app/Contents/Developer/usr/bin/git reset

reference

https://qiita.com/pgcmg00/items/0b94986290e8ae3a3b7e

Recommended Posts

[Swift5] What to do if you want to commit files to github but there are too many
What to do if you hit the wall of Too many symbol files when uploading with App Store Connect
What to do if you install Ubuntu
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if you accidentally create a model
What to do if you get a java.io.IOException in GlassFish
What to do if FacesMessage is set but not displayed
What to do if you installed Ruby with rbenv but the version does not change
# What to do if you accidentally do rails db: migrate: drop
What to do if you can't use the rails command
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if you get "Changes not staged for commit:" when you git status after git add.
What to do if you get a gcc error in Docker
What to do if you get a DISPLAY error in gym.render ()
What to do if you get angry with OpenSSL with pyenv install
[Logback] What to do if unnecessary files do not disappear during rotation
What to do if you forget the root password in CentOS7
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do if you can't get parameters with form_with
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
What to do if changes are not reflected after automatic deployment to EC2
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you get an error during rails db: reset
[Composer] [Laravel] What to do if you cannot install due to insufficient memory
What to do if you get an uninitialized constant Likes Controller error
What to do if you can't install the plugin from the Eclipse marketplace
[Swift] If you want to use a URL that includes Japanese, use addingPercentEncoding.
What to do if you get an error when you hit Heroku logs
What to do if you are told "there is no main manifest attribute" when creating a jar file containing dependencies in a maven project
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do when you want to delete a migration file that is "NO FILE"
What to do if you get Could not locate Gemfile or .bundle / directory
What to do if you can't activate the select box created by bootstrap-select
What to do if you get the error message unrecognized selector send to instance "***"
What to do if the changes are not reflected in the jar manifest file
What to do if you get an error on heroku rake db: migrate
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
[Rails] What to do when you want to generate an error that cannot be destory when foreign key restrictions are applied
What to do if you get angry with "ERROR: There are no scenarios; must have at least one" even though you should have entered yarn in Docker
If you want to modify database columns etc.
What to do if the server tomcat dies
What to do if mvn archetype: generate fails
What do you use when converting to String?
What to do if you get a wrong number of arguments error in binding.pry
What to do if you can't get the text of an element in Selenium
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if you get the error Couldn't find Item without an ID
What to do if you can't find your API key after deploying to Rails heroku
What to do if you get a port error when docker-compose up on Mac
What to do if you cannot execute with the command "Java package name / class name"
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war