What to do if you get "Changes not staged for commit:" when you git status after git add.

Contents

I tried to commit to GitHub, did git add. And checked with git status, but it was not reflected well with "Changes not staged for commit:"

The actual error content

python


$ git add .
$ git status
On branch login
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   app/controllers/users_controller.rb
	modified:   db/mysql/volumes/ib_logfile0
	modified:   db/mysql/volumes/ibdata1
	modified:   db/mysql/volumes/ibtmp1
	modified:   db/mysql/volumes/myapp_test/users.ibd
	modified:   db/mysql/volumes/mysql/innodb_index_stats.ibd
	modified:   db/mysql/volumes/mysql/innodb_table_stats.ibd
	modified:   spec/requests/users_signup_spec.rb

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   db/mysql/volumes/ibdata1

Solution

In the case of this error, it is said that "db / mysql / volumes / ibdata1" is not staged well, so specify the file name and execute the git add command.

python


$ git add db/mysql/volumes/ibdata1
$ git status
On branch login
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   app/controllers/users_controller.rb
	modified:   db/mysql/volumes/ib_logfile0
	modified:   db/mysql/volumes/ibdata1
	modified:   db/mysql/volumes/ibtmp1
	modified:   db/mysql/volumes/myapp_test/users.ibd
	modified:   db/mysql/volumes/mysql/innodb_index_stats.ibd
	modified:   db/mysql/volumes/mysql/innodb_table_stats.ibd
	modified:   spec/requests/users_signup_spec.rb

It was reflected properly!

Finally

I commit frequently, so if an error occurs, I want to deal with it without rushing.

Recommended Posts

What to do if you get "Changes not staged for commit:" when you git status after git add.
What to do if changes are not reflected after automatic deployment to EC2
What to do if you get an error when you hit Heroku logs
What to do if you get Could not locate Gemfile or .bundle / directory
What to do if you get Could not save master table to file after importing a project in Eclipse
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if you get a port error when docker-compose up on Mac
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What to do when the changes in the Servlet are not reflected
What to do if you get angry with OpenSSL with pyenv install
[Rails] What to do if you can't get parameters with form_with
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you install Ubuntu
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you get an error during rails db: reset
What to do if you get an uninitialized constant Likes Controller error
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if you get Application with name appName is already registered. When you try to start GlassFish
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if you push incorrect information
What to do when debugging "Source not found"
What do you use when converting to String?
What to do if you get a SQLite3 :: BusyException: database is locked error
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 have installed Java for OS X on macOS
What to do if you get an error on heroku rake db: migrate
What to do if you get angry if you don't have nokogiri while installing wp2txt
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if you get an "A server is already running." Error when you try to start the rails server
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
What to do if the update does not take effect after deploying Rails AWS
[Java] What to do if you get an error in Eclipse saying "Not allowed at source level below 1.X"
What to do if you get a wrong number of arguments error in binding.pry
What to do when JSF tags do not become HTML
What to do if you can't get the text of an element in Selenium
What to do if you accidentally create a model
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get the error Couldn't find Item without an ID
What to do when routing settings do not work after building Docker environment with Laravel
What to do if you can't find your API key after deploying to Rails heroku
How to make a jar with old Hadoop (hadoop-core-0.20.2-cdh3u6) in Gradle: (What to do if you get Could not expand ZIP ..)
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
[Java] [Spring] What to do if you cannot Autowire with Type Mismatch after annotating Spring Security
What to do when Git Repository cannot be displayed in Team Explorer for Eclipse in Azure
What to do if you installed Ruby with rbenv but the version does not change
What to do if you get a "302" error in your controller unit test code in Rails
[Swift5] What to do if you want to commit files to github but there are too many
What to do when Rails on Docker does not reflect controller changes in the browser
What to do if you get an error in Basic authentication during Rails test code
What to do when Method not found in f: ajax
What to do when you launch an application with rails
What to do if audio is not available on discordrb
What to do if FacesMessage is set but not displayed
# 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 a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if the app is not created with the latest Rails version installed when rails new