Script to get all modified files in GIT

I am developing a project base on a GIT repository. And want to get all
folder/files which have modification between my branch and the main
branch.
Is there any elegant and quick way to do this by using Ruby script?