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(.))

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

  1. 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# Introduc ...

  2. javax.imageio.IIOException: Can't create cache file!

    javax.imageio.IIOException: Can't create cache file! at javax.imageio.ImageIO.createImageInputStream ...

  3. Couldn't create temporary file to work with

    Ubuntu中当你编译安装软件的时候可能会出现Couldn't create temporary file to work with,原因可能是: 1.权限问题  2.根目录下没有tmp文件夹 解决办 ...

  4. wordpress无法安装这个包。: PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file 'C:\WINDOWS\TEMP/wordpress-4.tmp'

    朋友的wp博客好久没管理了,让ytkah帮忙打理一下,进到后台发现版本还是3.9的,那是比较早以前的版本了,早该升级了. 在升级wordpress时出现以下错误: 无法安装这个包: PCLZIP_ER ...

  5. MySQL [Warning] Can’t create test file xxx lower-test(转)

    add by zhj:修改的数据库的datadir,然后数据库就无法启动了,错误如下 2014-12-11 16:22:57 26309 [Warning] Can't create test fil ...

  6. Windows 7中,用Visual Studio开发WPF应用程序,实现从Windows Explorer中拖拽文件到应用程序,始终显示“无法拖放”符号问题解决方案

    Are you running your application or Visual Studio that hosts the app under administrative privilege? ...

  7. linux,安装软件报错cannot create regular file '/usr/local/man/man1': No such file or directory

    make install时报错,如下 install: cannot create regular file '/usr/local/man/man1': No such file or direct ...

  8. No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).

    Configuration Error Description: An error occurred during the processing of a configuration file req ...

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

    由于我在平日的学习与工作中会经常用到Cygwin中的Emacs,很自然地想到应该将emacsclient作为指定文件类型在Windows explorer中的默认打开程序.这样,便可以直接双击文件后在 ...

随机推荐

  1. 第11月第11天 avplayer循环播放

    1. /* Setting actionAtItemEnd to None prevents the movie from getting paused at item end. A very sim ...

  2. 在Windows 2008上安装Windows Mobile设备中心

    我在windows2008系统上安装Microsoft Windows Mobile Device Center v6.1时,老是弹出对话框提示缺少一个Windows Mobile设备中心所需要的Wi ...

  3. Java内存模型-final域的内存语义

    一 引言 说到final你肯定知道它是Java中的关键字,那么它所在Java中的作用你知道吗?不知道的话,请前往这篇了解下https://www.cnblogs.com/yuanfy008/p/802 ...

  4. 在VMware上安装Ubuntu软件步骤与遇到的相关问题及解决方案

    图解演示环境版本: 本机系统: WIN10 虚拟机:VMware Workstation 12(中文版) 安装目标:Ubuntu Desktop 12.04 LTS  (请点击这里)先下载好iso镜像 ...

  5. MongoDB学习笔记-1

    mongod --dbpath D:\MogonDB3.4.10\db //开启数据库,无端口号mongod --dbpath D:\MogonDB3.4.10\db --port=10086 //开 ...

  6. Linix下修改mysql服务器编码

    1. 找到mysql的配置文件,拷贝到etc目录下,第一步很重要 把/usr/share/doc/mysql-server-5.1.52/my-large.cnf 复制到 /etc/my.cnf 即用 ...

  7. 【OOB】MSHTML!CPaste­Command::Convert­Bitmapto­Png heap-based buffer overflow学习

    IE 11 MSHTML!CPaste­Command::Convert­Bitmapto­Png heap-based buffer overflow学习 MS14-056, CVE-2014-41 ...

  8. 基于用Path.Combine的优化

    Path.Combine: 什么时候会用到Path.Combine呢?,当然是连接路径字符串的时候! 所以下面的代码可以完美的工作: public static void Main() { strin ...

  9. lrzsz安装

    当服务器没有安装FTP等工具上传文件时,可以通过rz上传文件,sz    文件名  进行下载文件,默认下载路径为: C:\Users\用户\Downloads,安装如下: yum install lr ...

  10. PHP获取访问者公网IP

    if(!empty($_SERVER["HTTP_CLIENT_IP"])){  $cip = $_SERVER["HTTP_CLIENT_IP"]; } el ...