我的程序通常生成巨大的输出文件(~1 GB),我不想备份到git存储库.所以不是能够做到的
git add .
Run Code Online (Sandbox Code Playgroud)
我必须做点什么
git add *.c *.cc *.f *.F *.C *.h *.cu
Run Code Online (Sandbox Code Playgroud)
这有点麻烦......
我相信我可以编写一个快速的perl脚本,将目录内容写入.gitignore,然后根据.gitinclude(或类似名称)文件删除文件,但这似乎有点过于苛刻.有没有更好的办法?
这是我的.gitignore:
#ignore all kind of files
*
#except php files
!*.php
Run Code Online (Sandbox Code Playgroud)
我想要的只是忽略除了.php之外的所有文件,但是这个.gitignore我也忽略了文件夹...
有没有办法告诉git接受我的项目文件夹结构,同时只保留.php文件的轨道?
好像现在我无法在我的仓库中添加文件夹:
vivo@vivoPC:~/workspace/motor$ git add my_folder/
The following paths are ignored by one of your .gitignore files:
my_folder
Use -f if you really want to add them.
fatal: no files added
Run Code Online (Sandbox Code Playgroud)