我有一個骯髒的工作樹,髒,因爲我對源文件進行了更改,並觸及了一些圖像。我試圖只將圖像添加到索引,所以我跑了這個命令:Git添加無法使用.png文件?
git add *.png
但是,這不會添加文件。有幾個新的圖像文件被添加,但沒有被修改/預先存在的被添加。
什麼給?
編輯:下面是一些有關的終端輸出
$ git status
# On branch master
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: src/main/java/net/plugins/analysis/FormMatcher.java
# modified: src/main/resources/icons/doctor_edit_male.png
# modified: src/main/resources/icons/doctor_female.png
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# src/main/resources/icons/arrow_up.png
# src/main/resources/icons/bullet_arrow_down.png
# src/main/resources/icons/bullet_arrow_up.png
no changes added to commit (use "git add" and/or "git commit -a")
然後執行 「GIT中添加* .PNG」(沒有命令後輸出)
然後:
$ git status
# On branch master
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: src/main/resources/icons/arrow_up.png
# new file: src/main/resources/icons/bullet_arrow_down.png
# new file: src/main/resources/icons/bullet_arrow_up.png
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: src/main/java/net/plugins/analysis/FormMatcher.java
# modified: src/main/resources/icons/doctor_edit_female.png
# modified: src/main/resources/icons/doctor_edit_male.png
怪異:/你能給出一些信息呢?來自'git status'的摘錄或其他內容? – 2010-05-24 20:01:02
他們沒有出現在「git commit -a」屏幕上,對嗎? – 2010-05-24 20:02:18
您確定通配符與您希望添加的已修改文件相匹配嗎? (簡單測試:'ls * .png'顯示它們嗎?) – Cascabel 2010-05-24 20:07:01