当我输入 git status 时,我收到以下消息:
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)
modified: .DS_Store
modified: README.txt
modified: lib/PriceSeries.rb
Untracked files:
(use "git add <file>..." to include in what will be committed)
MM8 Prices.pdf
prices from EH.xlsx
Run Code Online (Sandbox Code Playgroud)
我希望能够说git add .,不添加未跟踪的文件。我相信 .gitignore 文件应该是为此。我的 .gitignore 文件(在 .git 文件夹中)如下所示:
#Ignore all xlsx files
.xlsx
#Ignore all pdf file
.pdf
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
为您的扩展添加前缀*:
#Ignore all xlsx files
*.xlsx
#Ignore all pdf file
*.pdf
Run Code Online (Sandbox Code Playgroud)
[更新]另外,.gitignore必须在你的项目的根目录下,而不是在.git
| 归档时间: |
|
| 查看次数: |
2863 次 |
| 最近记录: |