草庐IT

GitIgnore

全部标签

git - git ignore 和 untrack 的区别

在git中忽略文件夹和取消跟踪有什么区别?我需要从我的git存储库中删除一些文件夹,我在Netbeans中使用git插件工作,并且错误地将build、dist和nbproject文件夹放入我的存储库中,现在我需要删除这些文件夹。 最佳答案 如果您在存储库中创建一个名为.gitignore的文件,git将在查看要提交的文件时使用其规则。在将规则添加到该文件以忽略它之前,git不会忽略已经跟踪的文件(即在repo中)。必须使用取消跟踪文件(从存储库中删除)gitrm--cachedfilename该命令将停止跟踪但保持文件完整。

git - 在 .gitignore 中 merge 冲突

我有2个分支,master和newfeature。当我想将newfeaturemerge到master中时,我使用了:gitcheckoutmastergitmergenewfeature我得到错误:Auto-merging.gitignoreCONFLICT(content):Mergeconflictin.gitignoreAutomaticmergefailed;fixconflictsandthencommittheresult.我打开了.gitignore,现在看起来一团糟,文件的最后一部分看起来像>>>>>>newfeature发生了什么,应该如何解决才能将分支merge到

git - 在 .gitignore 中 merge 冲突

我有2个分支,master和newfeature。当我想将newfeaturemerge到master中时,我使用了:gitcheckoutmastergitmergenewfeature我得到错误:Auto-merging.gitignoreCONFLICT(content):Mergeconflictin.gitignoreAutomaticmergefailed;fixconflictsandthencommittheresult.我打开了.gitignore,现在看起来一团糟,文件的最后一部分看起来像>>>>>>newfeature发生了什么,应该如何解决才能将分支merge到

git - 配置 git 以仅跟踪一个文件扩展名

我有一个包含多种不同文件的目录树。父目录上有300个目录。每个目录可以有其他子目录。我只想跟踪所有子目录中的*.cocci。这是我的.gitignore:*!*.cocci但它不起作用,因为子目录中的文件未被跟踪。我如何告诉git我只想跟踪所有子目录上的*.cocci? 最佳答案 阅读thisquestion.你想要:#Blacklisteverything*#Whitelistalldirectories!*/#Whitelistthefileyou'reinterestedin.!*.cocci请注意,这将仅*.cocci文件进

git - 配置 git 以仅跟踪一个文件扩展名

我有一个包含多种不同文件的目录树。父目录上有300个目录。每个目录可以有其他子目录。我只想跟踪所有子目录中的*.cocci。这是我的.gitignore:*!*.cocci但它不起作用,因为子目录中的文件未被跟踪。我如何告诉git我只想跟踪所有子目录上的*.cocci? 最佳答案 阅读thisquestion.你想要:#Blacklisteverything*#Whitelistalldirectories!*/#Whitelistthefileyou'reinterestedin.!*.cocci请注意,这将仅*.cocci文件进

javascript - Angular2.gitignore

我正在设置一个Angular2示例项目。我的.gitignore已经足够了吗?还是我错过了什么?node_modulestypingsjspm_packagesbower_componentsapp/**/*.jsapp/**/*.map 最佳答案 angular-cli生成#Seehttp://help.github.com/ignore-files/formoreaboutignoringfiles.#compiledoutput/dist/tmp/out-tsc#dependencies/node_modules#IDEsan

javascript - Angular2.gitignore

我正在设置一个Angular2示例项目。我的.gitignore已经足够了吗?还是我错过了什么?node_modulestypingsjspm_packagesbower_componentsapp/**/*.jsapp/**/*.map 最佳答案 angular-cli生成#Seehttp://help.github.com/ignore-files/formoreaboutignoringfiles.#compiledoutput/dist/tmp/out-tsc#dependencies/node_modules#IDEsan

ruby - 为什么 git 在 vendors 目录中查找?

我有包含以下代码的.gitignore文件:/app/cache/*/app/logs/*/app/bootstrap*/vendor/*/web/bundles//app/config/parameters.yml但是当我这样做的时候:$gitstatus在任何情况下(添加和提交之前和之后),我都会得到这样的长文本输出:...#deleted:vendor/doctrine/orm/tools/sandbox/cli-config.php#deleted:vendor/doctrine/orm/tools/sandbox/doctrine#deleted:vendor/doctrin

ruby - 为什么 git 在 vendors 目录中查找?

我有包含以下代码的.gitignore文件:/app/cache/*/app/logs/*/app/bootstrap*/vendor/*/web/bundles//app/config/parameters.yml但是当我这样做的时候:$gitstatus在任何情况下(添加和提交之前和之后),我都会得到这样的长文本输出:...#deleted:vendor/doctrine/orm/tools/sandbox/cli-config.php#deleted:vendor/doctrine/orm/tools/sandbox/doctrine#deleted:vendor/doctrin

git - 从 IntelliJ IDEA 的版本控制中删除文件

我使用的是IntelliJIDEA社区版2016.1。我已将我的项目放在Git下,并将其托管在GitHub上。当我第一次点击在GitHub上共享项目按钮时,每个文件都被选中置于版本控制之下。现在我想从版本控制中排除模块IML文件。显然,我想把它保存在我的硬盘上。不幸的是,我找不到办法做到这一点。我如何实现这一点?我尝试从Web界面删除它,但在pull/推时遇到一些fatalerror。 最佳答案 有个小技巧。转到文件菜单->设置|版本控制|确认,然后检查Whenfilesarecreated部分下的Showoptionsbefore