How can I ask what commits are different between my current local branch and the remote repository that I push to?
Not exactly a git diff origin/master master
-- I don't want to see code differences. Just a list of changes like git log
.
I want to quickly see how long it's been since I pushed and how out of sync I am.
You can git branch -a to list all branches (local and remote) and then choose the branch name from the list (just remove remotes/ from the remote branch name. Example: git diff main origin/main (where "main" is the local main branch and "origin/main" is a remote, namely the origin and main branch.)
No, unless you explicitly push your changes to the remote branch, your changes will only be in your local repository.
To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..
Git can not send this information remotely.
You would have to do a Git fetch (fetching the changes, without altering your working copy). You will then have a branch called "origin/master" which will enable you to use git log master..origin/master
to get the variance between the two.
git fetch git log master..origin/master
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