如何在Windows 10中创建.gitignore文件 [英] How to create a .gitignore file in Windows 10

查看:230
本文介绍了如何在Windows 10中创建.gitignore文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用命令在存储库的根目录中创建.gitignore文件

I tried to create a .gitignore file in my repository's root directory with the command

$ touch .gitginore

在Git Bash中.

in Git Bash.

但是,当我从Windows资源管理器查看文件时.它说这是一个文本文件.它不是应该是File类型吗?

But when I looked at the file from the Windows Explorer. It says it's a text document. Isn't it supposed to be of the type File?

推荐答案

touch .gitignore可以正常工作. Windows将其检测为文本文件,但git应该可以正常工作.

touch .gitignore works just fine. Windows detects it as a text file but git should works perfectly.

为确保这一点,您可以键入ls -la,您应该看到所有带有扩展名的文件,包括.gitignore,如下图所示:

To be sure of it, you can type ls -la and you should see all your files with their extensions, including .gitignore just like in the following picture:

这篇关于如何在Windows 10中创建.gitignore文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆