Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all files that have been modified in git branch

Tags:

git

branch

Is there a way to see what files have changed in a branch?

like image 899
Raif Avatar asked May 17 '12 18:05

Raif


People also ask

How do you find list of files that have been changed in a particular commit?

Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command.


2 Answers

An alternative to the answer by @Marco Ponti, and avoiding the checkout:

git diff --name-only <notMainDev> $(git merge-base <notMainDev> <mainDev>) 

If your particular shell doesn't understand the $() construct, use back-ticks instead.

like image 179
twalberg Avatar answered Oct 19 '22 18:10

twalberg


All you have to do is the following:

git checkout <notMainDev> git diff --name-only <mainDev> 

This will show you only the filenames that are different between the two branches.

like image 27
Marco Ponti Avatar answered Oct 19 '22 19:10

Marco Ponti