.gitignore将Git与Visual Studio Solutions(.sln)和Projects 结合使用时,我应该包含哪些文件?
我需要在我的.gitignore文件中添加一些规则,但是,我在项目文件夹中找不到它.它不是由Xcode自动创建的吗?如果没有,什么命令允许我创建一个?
我的git项目包含我不想被推送到存储库的.cas文件.我因此添加了这条线
**/*.cas
Run Code Online (Sandbox Code Playgroud)
到我的.gitignore文件但.cas文件仍会出现git status.阅读了许多其他帖子后,我检查了.gitignore条目没有尾随空格,并且它们确实有unix行更改说明符.
然后我按照这里的建议运行以下命令: .gitignore不起作用
git rm -r --cached .
git add .
Run Code Online (Sandbox Code Playgroud)
但是徒劳!git status仍然报告例如
new file: calc/2_preliminary/1_CFD/7_Calc_Fluent/03_stationary_vof_stationary/mesh_04/run_10000.cas
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我真的很感激.
.gitignore 文件内容:
calc/
0_BSc_Alvarez/
calc/0_Test/
documentation/Tutorial_Fluent/
literature/
thunderbird/
**/.idea/
.zim
**/ND800_*
**/*.cas
**/*.dat
**/*.cdat
**/*.uns
**/*.msh
**/*.bak
Run Code Online (Sandbox Code Playgroud)
git版本是1.7.1
我在我的ASP.NET MVC项目中使用git.
我想无论从文件debug,bin或config文件夹中的"待Chages"对话框中显示广告,因此我不会将它们提交到我的仓库.
这些文件是特定于机器的,特别是config文件夹.
我尝试将以下内容添加到.gitignore:
myproject\bin**
myproject\obj**
myproject\config\**
Run Code Online (Sandbox Code Playgroud)
这不起作用,因为在每次构建或配置更改后,仍会显示所有三个文件夹下的所有文件.
我究竟做错了什么?
当我输入 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)
我究竟做错了什么?