How to create .gitignore file in Windows Explorer

How to create .gitignore file

I need to add some rules to my .gitignore file, however, I can‘t find it in my project folder. Isn‘t it created automatically by Xcode? If not, what command allows me to create one?

echo ‘xxx‘ > .gitignore 

To get around this I used the following steps

  1. Create the text file gitignore.txt
  2. Open it in a text editor and add your rules, then save and close
  3. Hold SHIFT, right click the folder you‘re in, then select Open command window here
  4. Then rename the file in the command line, with ren gitignore.txt .gitignore

The easiest way to create the .gitignore file in Windows Explorer is to create a new file named

.gitignore.

This will skip the validation of having an file extension, since is actually has an empty file extension.

========== In WINDOWS ==========

  1. Open notepad.
  2. Add the contents of your gitignore file.
  3. Click "Save as" and select "all files".
  4. Save as .gitignore.

======== Easy peasy! No command line required! ========

in windows, open a dos prompt(cmd) windows, use command line:

type > .gitignore

Few ways to create .gitignore using cmd:

  • With copy con command:

    1. open cmd and say cd to your git repository
    2. say copy con .gitignore and press Ctrl+Z.
  • With start notepad .gitignore command:

    1. open cmd and say cd to your git repository
    2. say start notepad .gitignore and press Yes button in opened notepad dialog box.
  • With edit .gitignore command (Windows x86 only):

    1. open cmd and say cd to your git repository
    2. say edit .gitignore and close opened edit editor.

if you use Sublime as your IDE you can create a new file and save it as .gitignore.

Simply using ctrl N for the new file, and ctrl S to save as ".gitignore".

I use notepad++. New File > SaveAs > .gitignore (Save as type -> All types(.))

时间: 2024-10-07 04:17:30

How to create .gitignore file in Windows Explorer的相关文章

create Context Menu in Windows Forms application using C# z

In this article let us see how to create Context Menu in Windows Forms application using C# Introduction In this article we will see how to create Context Menu or Popup Menu or Shortcut menu in Windows Forms application with ContextMenuStrip control

gradle clean can't delete file on Windows

Every now and again I run into a problem where cleaning my Android build folder just doesn't work. You can use File Explorer, gradle, even WSL with a `sudo rm -rf app/build`, yet I am still unable to delete it. It's usually a single file that gets st

windows下启动redis提示Invalid argument during startup: Failed to open the .conf file: redis.windows.connf CWD=C:\Users\Administrator

环境:Windows 7 64bit 旗舰版 redis 3.2.100 64bit 开始的时候,redis运行的好好的,不过每次启动都要要进入其路径,挺麻烦的,所以就想把它的路径设置到环境变量里,然后直接运行就出现错误:Invalid argument during startup:Failed to open the .conf file: redis.windows.connf CWD=C:\Users\Administrator 网上搜索了好久也找不到解决办法.后来想是不是因为环境变量的

SP2-0110: Cannot create save file "afiedt.buf"

sp2-0110:无法创建保存文件"afiedt.buf" 出处:此问题是由于使用 define _editor=vim 时,用ed更改时报错 问题原因:Cannot create save file "afiedt.buf" 因为在执行 edit的时候 "afiedt.buf" 文件默认保存在你键入sqlplus命令时所在目录中 比如:你在 / 目录下进入sqlplus, 当你用edit时,"afiedt.buf"文件就会保

Linux出现cannot create temp file for here-document: No space left on device的问题解决

在终端输入:cd /ho 按tab键时,显示错误: bash: cannot create temp file for here-document: No space left on device 这是由于该磁盘的空间已经满了,这时候可以进行扩容,或者将该磁盘的部分目录迁移到别的磁盘. 以下为解决思路,查找最大的文件,然后将其干掉: 1.使用命令df -h 查看硬盘空间 2.命令top查看cpu及内存 3.使用命令du -h –max-depth=1 /var/log/* 查看/var/log路

将Cygwin Emacs设为Windows explorer默认打开程序

由于我在平日的学习与工作中会经常用到Cygwin中的Emacs,很自然地想到应该将emacsclient作为指定文件类型在Windows explorer中的默认打开程序.这样,便可以直接双击文件后在Emacs中编辑,从而省去了在Cygwin命令行下手动输入路径与文件名的麻烦,亦可以用方便快捷的Windows explorer替代Emacs Dired mode.要实现这样的功能,需要解决两个问题: 从Windows文件路径格式到Cygwin路径格式的转换. 对于XP操作系统,中文文件名为GBK

[.net] 关于CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files… ‘Access is denied.’ 的解决办法

[.net] 关于CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files… ‘Access is denied.’ 的解决办法 1.添加用户"Network Service” 和 “IIS_IUSERS” 读下面目录的读写权限 a) C:\Windows\Temp b) C:\Windows\Microsoft.NET\Framewo

xp系统报错 windows explorer has encountered a problem and needs to close.We are sorry for the inconvenience

xp系统遇到问题: 打开某个软件提示报错信息, windows explorer has encountered a problem and needs to close.We are sorry for the inconvenience. 原因: 动态库未注册或者动态库缺少 解决办法: (1)打开 start,然后在run里面输入regsvr32 /u vsfilter.dll,然后回车. (2)接着在run 里面输入regsvr32 /u shmedia.dll 如果提示vsfilter.

170318 11:44:26 [ERROR] Can't start server: can't create PID file: No space left on device

数据库挂了.打开远程,进了系统,service mysqld stop 失败.service mysqld start等了好大一会,提示Timeout error occurred trying to start MySQL Daemon 出现Can't start server: can't create PID file: No space left on device这个错误. 提示磁盘空间不足 后用df -h 命令查看 竟然发现磁盘容量全部用完了,于是要查看是谁占用了用命令:find /