搜尋

首頁  >  問答  >  主體

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 天前794

全部回覆(5)我來回復

  • 天蓬老师

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

    用git add .

    回覆
    0
  • 世界只因有你

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

    即使用add i指令也不應該選擇那個4,因為你的文件不是從未被追蹤過的,4適用於新增加的文件,所以我覺得應該選2,或者換用git add 文件名形式的

    回覆
    0
  • 阿神

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

    1.先git status查一下是否发生版本冲突了
    2.如果没问题就git rm --cache themes/next從庫中刪除了重新add一次試試

    回覆
    0
  • 为情所困

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

    git commit -m「已更新」

    回覆
    0
  • 大家讲道理

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

    首先樓主的問題不是無法提交上去而是無法加入暫存區。我之前在使用VS的git插件中也遇到這樣的問題,可能是因為那個檔案根本沒有被修改。建議樓主把那份文件打開,然後儲存一下。另外,為了進一步確認,請在git add之前可以使用git diff查看那個文件的變更。

    回覆
    0
  • 取消回覆