Git ignore file for C projects

后端 未结 3 1923
余生分开走
余生分开走 2020-12-16 12:24

I\'ve just started to learn C (using Thinking In C) and I\'m wondering about what files I should be ignoring in a C project\'s git repository.

No suggestion can be

3条回答
  •  猫巷女王i
    2020-12-16 13:16

    I guess there will be a few generated files that you don't wan't to be sticking in your repo (assuming your build output dir is in your git heirachy):

    • object files (.o, o.obj)
    • libraries (.lib)
    • DLLs, shared objects (.so, .dll)
    • Executables (.exe, a.out ?)

    GIT ignore files are something I tend to do iteratively. "Hey, I don't need those things in my repo" ...

    Edit: re dmckee's comment

    Yep, you definately want to be ignoring swap files, temp files etc. I have the following as a baseline for my .gitignore:

    • *.swp
    • .~
    • thumbs.db

提交回复
热议问题