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. 【洛谷 P2726】 [SHOI2005]树的双中心(树的重心)

    先考虑一个\(O(N^2)\)做法. 设选的两个点为\(x,y\),则一定可以将树分成两个集合\(A,B\),使得\(A\)集合所有点都去\(x\),\(B\)集合所有点都去\(y\),而这两个集合的 ...

  2. 月薪20K软件测试自动化岗必问面试题:验证码识别与处理

    本文乃Happy老师的得意门生来自java全栈自动化测试4期的小核桃所作.正所谓严师出高徒,笔下有黄金~~让我们一起来征服面试官吧~~ 在做自动化测试的时候,经常会遇到需要输入验证码的地方,有些可以让 ...

  3. 【干货】查看windows文件系统中的数据—利用簇号查看文件与恢复文件

    前面我们使用这个软件发现了很多删除掉的数据,今天来看看簇.FAT文件系统中,存在一个簇的链接,我知道了簇1在哪里就可以顺藤摸瓜恢复所有的信息. 这里使用FAT 12为例子,FAT其他万变不离其宗,甚至 ...

  4. echo变量失败,提示:ECHO 处于关闭状态

    检查变量值,变量值为空就会提示关闭

  5. 微信小程序调用接口返回数据或提交数据

    由于小程序发起网络请求需要通过 wx.request 文档地址 https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-request.html 习 ...

  6. java iterator

    list l = new ArrayList(); l.add("aa"); l.add("bb"); l.add("cc"); for ( ...

  7. 2018-11-3& maven

    https://www.cnblogs.com/clsn/p/7944116.html#auto_id_10 http://www.runoob.com/maven/maven-creating-pr ...

  8. centos:SSH登录时间很慢

      vi /etc/ssh/sshd_config   GSSAPIAuthentication 改为 no 开启UseDNS,值改为 no   service sshd restart

  9. 四、vue语法补充

    1.自定义过滤器 格式: {{ msg | filters}} 2.computed 属性默认只有 getter ,不过在需要时你也可以提供一个 setter <!DOCTYPE html> ...

  10. pixel像素基础

    地址:http://www.imooc.com/video/9564 dp(安卓),pt(iphone)是物理像素 ppi是由物理像素确定的 一英寸内有多少个像素渲染,ppi越高,图片越清晰 1px ...