I want to view git commits when my branch is ahead of origin branch.
i tried git log
it returns all commits. but, i want to view only ahead commits
from branch to origin/branch
here what i mean,
On branch permissions Your branch is ahead of 'upstream/permissions' by 2 commits. (use "git push" to publish your local commits) nothing to commit, working directory clean
in this case i want to view 2 commits
Git rev-list will list commits in one branch that are not in another branch. It is a great tool when you're trying to figure out if code has been merged into a branch or not. Using the --oneline option will display the title of each commit. The ^ operator excludes commits in the specified branch from the list.
There is nothing to fix. You simply have made 3 commits and haven't moved them to the remote branch yet. There are several options, depending on what you want to do: git push : move your changes to the remote (this might get rejected if there are already other changes on the remote)
The message you are seeing (your branch is ahead by one commit) means your native repository has one commit that hasn't been pushed yet. In other words: add and commit are local operations, push, pull and fetch are operations that interact with a remote.
Simple,
git log branch...origin/branch
Or little more beautiful :
git log --graph --color --decorate --oneline branch...origin/branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With