how to find out list of all changed files in git for full jenkins build and not for a particular commit?

前端 未结 5 1663
梦毁少年i
梦毁少年i 2020-12-05 19:57

How to find all changed files since last commited build in GIT ? I want to build not only the changed files at head revision but also, all the changed files which got chang

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 20:13

    If you need this for Jenkins.

    prev_merge=$(git log |grep -C1 Merge | grep commit |head -n1 | awk {'print $2'})
    commit=$(git log |head -n 1  | awk {'print $2'})
    git diff --name-only $prev_merge $commit
    

提交回复
热议问题