gpt4 book ai didi

git - 让 git 忽略文件

转载 作者:IT王子 更新时间:2023-10-29 01:18:17 27 4
gpt4 key购买 nike

我试图让 git 忽略我的一些文件,我找到了一个关于如何做到这一点的描述

From: http://github.com/guides/git-cheat-sheet TO IGNORE SOME FILES

Add a file in the root directory called .gitignore and add some files to it: (comments begin with hash) *.log db/schema.rb db/schema.sql

Git automatically ignores empty directories. If you want to have a log/ directory, but want to ignore all the files in it, add the following lines to the root .gitignore: (lines beginning with ‘!’ are exceptions)

log/* !.gitignore

Then add an empty .gitignore in the empty directory:

touch log/.gitignore

所以我在我的项目文件夹中创建了一个名为 .gitignore 的文件,并在其中写入以下内容:

phpMyAdmin/*
nbproject/*
inc/mysql_config.php
!.gitignore

但是当我提交时,文件被排除在提交之外......

最佳答案

https://www.gitignore.io/

我创建了一个网络实用程序,可以帮助您为项目生成有用的 .gitignore 文件。它将帮助您忽略操作系统、编程语言和 IDE 生成的文件。

关于git - 让 git 忽略文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3220629/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com