How to .gitignore all files/folder in a folder, but not the folder itself?
https://stackoverflow.com/questions/4250063/how-to-gitignore-all-files-folder-in-a-folder-but-not-the-folder-itself/5581995#5581995
put this .gitignore into the folder, then git add .gitignore
*
*/
!.gitignore
The *
line tells git to ignore all files in the folder, but !.gitignore
tells git to still include the .gitignore file. This way, your local repository and any other clones of the repository all get both the empty folder and the .gitignore it needs.
Edit: May be obvious but also add */ to the git ignore to also ignore sub folders.
How to .gitignore all files/folder in a folder, but not the folder itself?的更多相关文章
- CMake Error at cmake/OpenCVModule.cmake:295 (message): No extra modules found in folder:Please provide path to 'opencv_contrib/modules' folder
其实,我们使用的opencv中要用的contrib/modules 是需要额外下载并在cmakelists.txt中指定的 git clone https://github.com/opencv/ ...
- Mac下Git项目使用的.gitignore文件
https://www.gitignore.io/ 这个网站可以搜索特定项目.系统所需要的.gitignore 我现在主要是在Mac上用Visual Studio Code进行开发,所以直接搜索Mac ...
- git路径超长 及gitignore
1 忽略路径超长 git config --system core.longpaths true 2 比较全的gitignore https://www.gitignore.io/api/vim,no ...
- 官方VisualStudio.gitignore配置
官方地址 https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 示例 ## Ignore Visual Stud ...
- The specified file or folder name is too long
You receive a "The specified file or folder name is too long" error message when you creat ...
- How to: Synchronize Files by Using Managed Code
The examples in this topic focus on the following Sync Framework types: FileSyncProvider FileSyncOpt ...
- Umbraco 上传文件到另一个文件夹,而不是media files
If you want to upload there media files to another place in the same instance of IIS, for example a ...
- 从source folder 下将其所有子文件夹的*.* 文件拷贝到 target folder (不拷贝文件夹名仅拷贝文件)
因本人较懒,一直认为电脑能做的就让电脑来做,所以写下这个批处理的小脚本方便工作. 场景:碰到要拷贝一个文件夹(source folder)下的多个子文件夹(sub-folder)的文件到指定文件夹下( ...
- List or delete hidden files from command prompt(CMD)
In Windows, files/folders have a special attribute called hidden attribute. By setting this attribut ...
随机推荐
- Nachos-Lab3-同步与互斥机制模块实现
源码获取 https://github.com/icoty/nachos-3.4-Lab 内容一:总体概述 本实习希望通过修改Nachos系统平台的底层源代码,达到"扩展同步机制,实现同步互 ...
- crmv2项目
maven -----------------------------------------------------------------------------感谢打赏!
- Python基础笔记:高级特性:切片、迭代、列表生成式、生成器、迭代器
题记: 在python中,代码不是越多越好,而是越少越好.代码不是越复杂越好,而是越简单越好. 1行代码能实现的功能,绝不写5行代码. 请始终牢记:代码越少,开发效率越高. 切片 >>&g ...
- TensorFlow2 Part2:基础知识回顾
python面向对象编程回顾 基础概念: 面向对象的编程简称OOP,它把对象作为程序的基本单元,一个对象包含了数据和操作数据的函数. 面向对象的设计思想是抽象出Class,根据Class(类)创建In ...
- Android Studio模拟器无法访问网络
Android Studio3.5 模拟器无法访问网络的原因?
- C#重写窗体的方法
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- hdu 2583 How far away ? 离线算法 带权求最近距离
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- 2016蓝桥杯省赛C/C++A组第八题 四平方和
题意: 四平方和定理,又称为拉格朗日定理: 每个正整数都可以表示为至多4个正整数的平方和. 如果把0包括进去,就正好可以表示为4个数的平方和. 比如: 5 = 0^2 + 0^2 + 1^2 + 2^ ...
- hdfs 删除和新增节点
最近发现hdfs的一个问题,每当集群开启的时候,有一个节点上的可用空间就一直在减少,并且速度很快,发现是data目录下的dncp_block_verification.log.curr文件在一直变大, ...
- Java8大排序算法
一.冒泡排序 基本思想:通过对待排序序列此前向后,依次比较相邻元素的值,若发现逆序则进行交换,使得较大的值从前面移动到后面, 类似于水下的气泡一样(是所有排序算法中效率最低的) publi ...