Git post-receive to checkout only those files that have been modified/added in the push?

后端 未结 1 1920
南旧
南旧 2020-12-11 18:29

I have been using post-receive scripts in my git repositories with the following commands to checkout all of the files in the repository:

#!/bin/sh
GIT_WORK_         


        
相关标签:
1条回答
  • 2020-12-11 19:13

    you can use git diff to give you a list of files

    git diff --name-only from..to
    

    in a post-receive hook that'll be I think

    git diff --name-only $1..$2
    

    as this hook receives oldrev, newrev and ref on standard input

    0 讨论(0)
提交回复
热议问题