這裏是我的.gitignore文件:的.gitignore沒有忽視文件
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
# Ignore application configuration
/config/application.yml
/config/application.yml.bak
*.bak
現在,我的倉庫是在https://github.com/rmohan80/learn-rails
爲什麼我的最新承諾 - 「爲電子郵件添加配置」加Readme.rdoc .bak但忽略.gitignore.bak
任何線索?
我已經更新了問題,使其更加清晰。然而,問題不在於shell解釋 - 一個ls * .bak正確顯示所有包含.bak的文件 - 即4個文件 - 包括.gitignore.bak和Readme.rdoc.bak – zooter
@zooter,git使用稍微不同的規則。例如,領導/並不意味着你排除了文件系統根路徑中的某個文件。試試Slagt的第一個建議。修改其中一個新排除的文件並運行「git status」以查看沒有任何內容會被修改。 – benjamin
似乎沒有工作 - 我添加了。* .bak和輸出C:\ Users \ ram \ ruby \ learn-rails [master +3〜2 -0!]> git status 在分支主文件上 您的分支是up-以'origin/master'爲起始日期。 變化不連續上演承諾: (使用「混帳添加 ...」更新的內容將被提交) (使用「git的結帳 - ...」丟棄在工作目錄的變化) 修改:的.gitignore 修改:README.md.bak 未跟蹤文件: (使用 「混帳添加 ...」 在什麼將致力於包括) README.md.bak.bak 配置/環境/發展。 rb.bak config/secrets.yml.bak –
zooter