Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
838 views
in Technique[技术] by (71.8m points)

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

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 changed before that as well since last successful build.

git show --pretty="format:" --name-only will do the build only for top commit changed files. Like this, i need to build for all changed files in different commits since last successful build.

Like , last build done in Jenkins at X SHA-1 id, and after that , there are 3 more commits on top of it. So, my aim is to checkout whole repository codebase till head and then find out list of all files which got changed after X SHA-1 id , that are 3 commits on top of last commit at X SHA-1 id ?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Little late to the party but a slightly better way is to use the --name-only functionality on git diff. What I used is as follows:

git diff --name-only $GIT_PREVIOUS_COMMIT $GIT_COMMIT

This way you don't have to do some piping work afterward.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...