Automatically add .gitignore and hooks on git init

前端 未结 3 1207
闹比i
闹比i 2020-12-13 09:37

Is there a way to tell git to automatically create/populate .gitignore and certain files in the .git/hooks folder every time git init is run on a certain machin

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 10:33

    .gitignore_global in your home directory. If the file isn't there create it. Same syntax as .gitignore files. Be careful what you place in this file!

    If all users wish to share the same .gitignore file, you can create one in

    /.SHARED_GIT_IGNORE  
    

    Then create soft links to it in each respective users home directory.

    /Users/ALL_USERS/.gitignore_global -> /.SHARED_GIT_IGNORE
    

提交回复
热议问题