Specify branch name with -b (or --branch) to recall commits made on a different branch to the one that is checked out. So for example if I'm working on master and want to quickly browse commits I've made in a different release branch I can do so without checking out the release branch, avoiding a lengthy re-build when I go back to master.
Works very simply, just pass the branch name through to the git log command as the only positional parameter. Passing empty string gives usual default behaviour of displaying commits from the current checked-out branch.
Specify branch name with -b (or --branch) to recall commits made on a different branch to the one that is checked out. So for example if I'm working on master and want to quickly browse commits I've made in a different release branch I can do so without checking out the release branch, avoiding a lengthy re-build when I go back to master.
Works very simply, just pass the branch name through to the git log command as the only positional parameter. Passing empty string gives usual default behaviour of displaying commits from the current checked-out branch.