开发者

How to include only selected files into git repository and exclude all the rest?

开发者 https://www.devze.com 2023-03-23 11:51 出处:网络
Is there any chance to do an opposite to what .gitignore file does? I mean include only specified files and exclude all the re开发者_如何学Pythonst? Thank you in advance.You can try the following:

Is there any chance to do an opposite to what .gitignore file does? I mean include only specified files and exclude all the re开发者_如何学Pythonst? Thank you in advance.


You can try the following:

#ignore everything
*

#except .c source
!*.c

(! negates the patterns specified in gitignore)


if you want to concern only one folder in root try this:

# ignore everything
*
# except .gitignore file
!.gitignore
# except my folder
!concered_folder_name
!concered_folder_name/*
0

精彩评论

暂无评论...
验证码 换一张
取 消