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

前端 未结 5 1657
感情败类
感情败类 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 10:05

    Late to the party, but my solution would be to have a directory for source files and a different directory for executables and program output, something like this:

    + .git
    |    (...)
    + bin
    |    my_exe.exe
    |    my_output.txt
    + src
         some_file.c
         some_file.h 
    

    ... and then only add the stuff in src/ to my repository and ignore bin/ entirely.

提交回复
热议问题