In the context of a revision list, A...B is how git-rev-parse defines it. git-log takes a revision list. git-diff does not take a list of revisions - it takes one or two revisions, and has defined the A...B syntax to mean how it's defined in the git-diff manpage. If git-diff did not explicitly define A...B, then that syntax would be invalid. Note that the git-rev-parse manpage describes A...B in the "Specifying Ranges" section, and everything in that section is only valid in situations where a revision range is valid (i.e. when a revision list is desired).
To get a log containing just x, y, and z, try git log HEAD..branch (two dots, not three). This is identical to git log branch --not HEAD, and means all commits on branch that aren't on HEAD.
In the context of a revision list, A...B is how git-rev-parse defines it. git-log takes a revision list. git-diff does not take a list of revisions - it takes one or two revisions, and has defined the A...B syntax to mean how it's defined in the git-diff manpage. If git-diff did not explicitly define A...B, then that syntax would be invalid. Note that the git-rev-parse manpage describes A...B in the "Specifying Ranges" section, and everything in that section is only valid in situations where a revision range is valid (i.e. when a revision list is desired).
To get a log containing just x, y, and z, try git log HEAD..branch (two dots, not three). This is identical to git log branch --not HEAD, and means all commits on branch that aren't on HEAD.
git cherry branch [newbranch]
does exactly what you are asking, when you are in the master branch.
I am also very fond of:
git diff --name-status branch [newbranch]
Which isn't exactly what you're asking, but is still very useful in the same context.
Get all files that have been modified in git branch - Stack Overflow
Can I see all of my changes before I push them and open a PR?
github - Git how do I check if there are any changes in another branch - Stack Overflow
How check for updates
Videos
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.
For current branch you can use:
git diff --name-only $(git merge-base <mainDev> HEAD)
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.
I'm pretty new to git and I got the basic workflow down. Now I'm trying to improve my skills a bit with git.
Is there some easy way for me to review all of my changes before I push to a remote branch and open a PR?
It would be nice to make sure I didn't forget to remove any unnecessary comments and code. The main thing I could do is simply open the PR and check on Github "files changed" and review it there and do another commit and push if I need to clean things up.
But I'm not sure if there's a way to do this before the PR is even opened. I'm using Android Studio btw so if there's a way in Android Studio (which is basically IntelliJ) then that would be good.