git add正在向临时区域添加文件

时间:2014-01-09 08:06:13

标签: git github git-svn bitbucket

我正在尝试使用命令git add将一些修改过的文件提交到我的git临时区域。但是文件没有添加到暂存区域。

以下是git status的输出: -

  :~/Desktop/production-18-12-2013$ git status
    # On branch master
    # 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/application.js~
    #   deleted:    app/assets/javascripts/controllers/app.js~
    #   deleted:    app/assets/javascripts/menu.js~
    #   deleted:    app/assets/javascripts/services/userAPI.js~
    #   deleted:    app/assets/stylesheets/application.css~
    #   deleted:    app/assets/stylesheets/safariwindows.css~
    #   deleted:    app/assets/stylesheets/windowsapplication.css~
    #   deleted:    app/controllers/appi_controller.rb~
    #   deleted:    config/initializers/event_machine.rb~
    #   deleted:    public/assets/application-042a070a3832c680df06e7ea031766e7.js
    #   deleted:    public/assets/application-042a070a3832c680df06e7ea031766e7.js.gz
    #   deleted:    public/assets/application-17a2431c4f2227103425cec76c5b4507.js
    #   deleted:    public/assets/application-17a2431c4f2227103425cec76c5b4507.js.gz
    #   deleted:    public/assets/application-26253c7e7241dfc73bddea7e43ece04c.js
    #   deleted:    public/assets/application-26253c7e7241dfc73bddea7e43ece04c.js.gz
    #   deleted:    public/assets/application-321c36234afb9e931f847afc9e15356a.js
    #   deleted:    public/assets/application-321c36234afb9e931f847afc9e15356a.js.gz
    #   deleted:    public/assets/application-432a3132331e44e99dc825681de186fc.js
    #   deleted:    public/assets/application-432a3132331e44e99dc825681de186fc.js.gz
    #   deleted:    public/assets/application-4ce91df18f6d02b72a2d4fd6288b7e27.js
    #   deleted:    public/assets/application-4ce91df18f6d02b72a2d4fd6288b7e27.js.gz
    #   deleted:    public/assets/application-53f94195fd52dfe8bf42d8ce6f1d34ed.js
    #   deleted:    public/assets/application-53f94195fd52dfe8bf42d8ce6f1d34ed.js.gz
    #   deleted:    public/assets/application-5a7c32b4917ea37959fce75e96cda547.css
    #   deleted:    public/assets/application-5a7c32b4917ea37959fce75e96cda547.css.gz
    #   deleted:    public/assets/application-8c5483b4973e96b28612ecb18e4c3942.js
    #   deleted:    public/assets/application-8c5483b4973e96b28612ecb18e4c3942.js.gz
    #   deleted:    public/assets/application-a81a1274e455dbead72c22762b3c2a34.js
    #   deleted:    public/assets/application-a81a1274e455dbead72c22762b3c2a34.js.gz
    #   deleted:    public/assets/application-ceed710b515059aeb59a02f72b0b4dc3.js
    #   deleted:    public/assets/application-ceed710b515059aeb59a02f72b0b4dc3.js.gz
    #   deleted:    public/assets/application-ddabc637f1d7ed563483b991094b9692.js
    #   deleted:    public/assets/application-ddabc637f1d7ed563483b991094b9692.js.gz
    #   deleted:    public/assets/application-e47883af638c3eaeb828901746dc14a0.js
    #   deleted:    public/assets/application-e47883af638c3eaeb828901746dc14a0.js.gz
    #   deleted:    public/assets/application-e6c199f7b655bba181fdbabb83702335.js
    #   deleted:    public/assets/application-e6c199f7b655bba181fdbabb83702335.js.gz
    #   deleted:    public/assets/application-f546c5ac258ae2f4b2051bd5c09ad581.js
    #   deleted:    public/assets/application-f546c5ac258ae2f4b2051bd5c09ad581.js.gz
    #   deleted:    public/assets/application-f813e11ed5210d25e039736f7300b550.css
    #   deleted:    public/assets/application-f813e11ed5210d25e039736f7300b550.css.gz
    #   deleted:    public/assets/application.css
    #   deleted:    public/assets/application.css.gz
    #   deleted:    public/assets/application.js.gz
    #   deleted:    public/assets/application2-6a76bc78fbb8e38bfeb101cd769b3978.css
    #   deleted:    public/assets/application2-6a76bc78fbb8e38bfeb101cd769b3978.css.gz
    #   deleted:    public/assets/application2.css
    #   deleted:    public/assets/application2.css.gz
    #   deleted:    public/assets/ie-6051136603bde9acd2baf93c330af904.css
    #   deleted:    public/assets/ie-6051136603bde9acd2baf93c330af904.css.gz
    #   deleted:    public/assets/ie.css
    #   deleted:    public/assets/ie.css.gz
    #   deleted:    public/assets/jquery.min-2df7da5d7895835e8cc10130711ba4a6.map
    #   deleted:    public/assets/jquery.min.map
    #   deleted:    public/assets/manifest.yml
    #   deleted:    public/assets/rails-aa8aea913cd3b23f0cdf2a950a48069a.png
    #   deleted:    public/assets/rails.png
    #   deleted:    public/assets/safariwindows-64111c331f7b5da9cc8cbb61b70edba5.css
    #   deleted:    public/assets/safariwindows-64111c331f7b5da9cc8cbb61b70edba5.css.gz
    #   deleted:    public/assets/safariwindows.css
    #   deleted:    public/assets/safariwindows.css.gz
    #   deleted:    public/assets/safariwindows2-54679b90e662ef9657c0bac13cbfca79.css
    #   deleted:    public/assets/safariwindows2-54679b90e662ef9657c0bac13cbfca79.css.gz
    #   deleted:    public/assets/safariwindows2.css
    #   deleted:    public/assets/safariwindows2.css.gz
    #   deleted:    public/assets/untitled
    #   deleted:    public/assets/windowsapplication-ef6d76bdf635d72d487ee4c51cea9b27.css
    #   deleted:    public/assets/windowsapplication-ef6d76bdf635d72d487ee4c51cea9b27.css.gz
    #   deleted:    public/assets/windowsapplication.css
    #   deleted:    public/assets/windowsapplication.css.gz
    #   deleted:    public/assets/windowsapplication2-85d68c3cd237247123bb47428dc8a138.css
    #   deleted:    public/assets/windowsapplication2-85d68c3cd237247123bb47428dc8a138.css.gz
    #   deleted:    public/assets/windowsapplication2.css
    #   deleted:    public/assets/windowsapplication2.css.gz
    #
    no changes added to commit (use "git add" and/or "git commit -a")

然后编写命令git add

但这对我没有帮助,而git status正在给我上述输出(相同)

这是因为我在git status之前提出的git-update-index-assume-unchange命令

如果是这样,那么如何解决这个问题。我已经去了各种论坛,但没有得到输出。

请帮我解决这个问题

3 个答案:

答案 0 :(得分:1)

您没有任何更改的文件。您已从树中删除了文件。使用git rm暂存文件以进行删除(如它所示),然后提交。

答案 1 :(得分:1)

我认为您正在尝试删除在回购期间生成的多个间歇性文件,并已手动删除这些文件,现在正尝试提交更改。

如果是这种情况,您需要使用git rm删除这些内容。

如果您要删除特定文件,请执行git rm path/to/file

如果您要删除特定模式的所有文件,例如*~~.gz,请使用git rm -r "*~" "~.gz" "~.png"

另外,我建议将这些模式添加到.gitignore文件中,以便将来不会添加这些文件。

答案 2 :(得分:0)

你有没有试过git add --all