Is there a way to tell git to only include certain files instead of ignoring certain files?

前端 未结 5 1672
感情败类
感情败类 2020-12-12 09:16

My programs generally generate huge output files (~1 GB) which I do not want to be backing up to the git repository. So instead of being able to do

git add          


        
5条回答
  •  攒了一身酷
    2020-12-12 09:57

    create .gitignore file in your repository and you want to track only c files and ignore all other files then add the following lines to it....

    *
    !*.c
    

    '*' will ignore all files

    and ! will negate files be to ignored....so here we are asking git not to ignore c files....

提交回复
热议问题