suchen

Heim  >  Fragen und Antworten  >  Hauptteil

git怎么提交都失败

为什么提交htemes/next总是失败

$ git add -i
           staged     unstaged path
  1:    unchanged        +0/-0 themes/next

*** Commands ***
  1: status       2: update       3: revert       4: add untracked
  5: patch        6: diff         7: quit         8: help
What now> 4
No untracked files.

$ git add -A

$ git status
On branch blog
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)
  (commit or discard the untracked or modified content in submodules)

        modified:   themes/next (modified content)

no changes added to commit (use "git add" and/or "git commit -a")
过去多啦不再A梦过去多啦不再A梦2841 Tage vor796

Antworte allen(5)Ich werde antworten

  • 天蓬老师

    天蓬老师2017-05-02 09:46:38

    用git add .

    Antwort
    0
  • 世界只因有你

    世界只因有你2017-05-02 09:46:38

    即使用add i命令也不应该选择那个4,因为你的文件不是从未被追踪过的,4适用于新增加的文件,所以我觉得应该选2,或者换用git add 文件名形式的

    Antwort
    0
  • 阿神

    阿神2017-05-02 09:46:38

    1.先git status查一下是否发生版本冲突了
    2.如果没问题就git rm --cache themes/next从库中删了重新add一次试试

    Antwort
    0
  • 为情所困

    为情所困2017-05-02 09:46:38

    git commit -m "updated"

    Antwort
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:46:38

    首先楼主的问题不是无法提交上去而是无法加入暂存区。我之前在使用VS的git插件中也遇到过这样的问题,可能是因为那个文件根本没有被修改。建议楼主把那个文件打开,然后保存一下。另外,为了进一步确认,在git add之前可以使用git diff查看一下那个文件的变化。

    Antwort
    0
  • StornierenAntwort