2017-08-11 184 views
1

我在ASM中开发了一些源代码,但我不想保存二进制文件和obj文件,所有文件夹都是新的“项目”,一切都可以,但是当我在Ubuntu上做了一些改变,不作任何修改。例如。Git忽略除子目录中的某些文件以外的所有文件

/ 
    |- HelloWorld/ 
    |- hello.asm 
    |- hello.o 
    |- hello 
    |- SomeProject/ 
    |- some.asm 
    |- some.o 
    |- some 
    |- CProject/ 
    |- project.c 
    |- project.o 
    |- project 

我的.gitignore是:

# Ignore all ASM Binaries 
* 

# Except source codes files in root 
!*.c 
!*.asm 
!*.sh 
!*.gitignore 
!*.md 
!*.txt 
# And source code files in subdirectories 
!**/*.c 
!**/*.asm 
!**/*.sh 
!**/*.gitignore 
!**/*.md 
!**/*.txt 

也试过:

!*/*.txt 
!/**/*.txt 
!/*/*.txt 
!**/*.txt 

回答

0

解决,的.gitignore:

# Ignore all files 
* 

# Ignore all files in subdirectories 
#**/** 

# Unignore all with extensions 
!*.* 

# Unignore all files in subdirectories 
/* 
!/*.asm 
!/*.c 
!/*.sh 
!/*.md 
!/*.txt 
!/*/ 
/*/** 

!/**/*.asm 
!/**/*.c 
!/**/*.sh 
!/**/*.md 
!/**/*.txt 

# Except source code files 
!.gitignore 
!*.readme 
!*.c 
!*.asm 
!*.sh 
!*.md 
!*.txt 
相关问题