“git rm。”未在暂存区中添加已删除的文件

“git rm .” is not adding the deleted files in the staged area

我删除了项目的一些文件。我想将所有被淘汰的文件传递到暂存区,其中一些为git rm .,但我想使用通配符一次传递所有文件。

暂存淘汰文件的好方法是什么?

fernando@fernando:~/ProyectoTicketMaster/Ticket_Master$ git status
# On branch jquery
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   deleted:    app/assets/javascripts/bus_routes.js.coffee
#   modified:   config/routes.rb
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    app/assets/javascripts/schedules.js.coffee
#   deleted:    app/assets/stylesheets/bus_routes.css.scss
#   deleted:    app/assets/stylesheets/schedules.css.scss
#   deleted:    app/controllers/bus_routes_controller.rb
#   deleted:    app/controllers/schedules_controller.rb
#   deleted:    app/helpers/bus_routes_helper.rb
#   deleted:    app/helpers/schedules_helper.rb
#   deleted:    app/models/bus_route.rb
#   deleted:    app/models/schedule.rb
#   deleted:    app/views/bus_routes/_form.html.erb
#   deleted:    app/views/bus_routes/edit.html.erb
#   deleted:    app/views/bus_routes/index.html.erb
#   deleted:    app/views/bus_routes/new.html.erb
#   deleted:    app/views/bus_routes/show.html.erb
#   deleted:    app/views/schedules/_form.html.erb
#   deleted:    app/views/schedules/edit.html.erb
#   deleted:    app/views/schedules/index.html.erb
#   deleted:    app/views/schedules/new.html.erb
#   deleted:    app/views/schedules/show.html.erb
#   deleted:    db/migrate/20141223030318_create_bus_routes.rb
#   deleted:    db/migrate/20141231211702_create_schedules.rb
#   deleted:    test/fixtures/bus_routes.yml
#   deleted:    test/fixtures/schedules.yml
#   deleted:    test/functional/bus_routes_controller_test.rb
#   deleted:    test/functional/schedules_controller_test.rb
#   deleted:    test/unit/bus_route_test.rb
#   deleted:    test/unit/helpers/bus_routes_helper_test.rb
#   deleted:    test/unit/helpers/schedules_helper_test.rb
#   deleted:    test/unit/schedule_test.rb

在git你add删减。

git add -u

将更新您的索引,仅考虑您的历史记录中已经存在的文件。 因此它将考虑修改和删除,但不考虑新文件。