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

最新文章

  1. 来自沪江、滴滴、蘑菇街架构师的 Docker 实践分享
  2. 【原创】No matching distribution found for Twisted>=10.0.0 (from scrapy)
  3. [Node.js] 也说this
  4. Scrum站立会议----11月4日
  5. [转]KDE/QT与GNOME/GTK比较
  6. iOS 开发 NSLog调试小技巧
  7. 13.怎样自学Struts2之Struts2本地化[视频]
  8. 跟着辛星认识一下PHP的自己主动载入
  9. java--抽象类实例(包含静态内部抽象类)
  10. 深度学习识别CIFAR10:pytorch训练LeNet、AlexNet、VGG19实现及比较(二)
  11. 第十三周翻译-《Pro SQL Server Internals, 2nd edition》
  12. 使用rke快速安装K8s集群
  13. 【redis专题(7)】命令语法介绍之Pub/Sub
  14. Layer-level的快速算法
  15. [android] 手机卫士项目
  16. Delphi的关键字
  17. 容器平台选型的十大模式:Docker、DC/OS、K8S 谁与当先?【转】
  18. jackson JsonPropertyOrder和@JsonIgnoreProperties注解
  19. mpvue两小时,产出一个《点钞辅助工具》小程序
  20. PetaPoco:SkipTake 和 Page 中的 OrderBy 子句不支持 “[]” 的解决办法

热门文章

  1. 对git简单的认识
  2. Linux获取/dev/input目录下的event对应的设备【转】
  3. 安装Scrapy遇到的坑
  4. 002_CentOS-6.4-x86_64安装包的说明
  5. MYSQL数据库链接层- SUMMER-SQL
  6. jquery-css处理
  7. VM workstation 与 VM vSphere的区别 [转载]
  8. [转]solver优化方法
  9. io多路复用的精髓
  10. kafka 查看队列信息