Is there a way to see what files have changed in a branch?
Considering you're on a feature branch and you want to check which files have changed compared to master... just this:
git diff --name-only master
I really liked @twalberg's answer but I didn't want to have to type the current branch name all the time. So I'm using this:
git diff --name-only $(git merge-base master HEAD)
git diff --name-only master...branch-name
to which we want to compare.
I use grep so I only get the lines with diff --git which are the files path:
git diff branchA branchB | grep 'diff --git'
// OUTPUTS ALL FILES WITH CHANGES, SIMPLE HA :)
diff --git a/package-lock.json b/package-lock.json
Expanding off of what @twalberg and @iconoclast had, if you're using cmd for whatever reason, you can use:
FOR /F "usebackq" %x IN (`"git branch | grep '*' | cut -f2 -d' '"`) DO FOR /F "usebackq" %y IN (`"git merge-base %x master"`) DO git diff --name-only %x %y
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.