0

When I run the git status command I get the following message:

On branch master
Your branch and 'origin/master' have diverged, and have 1 and 15 different commits each, respectively. (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean

What I understand from the above message is that I have 1 local change and 15 changes in the remote.

I am pretty sure that the 1 change made locally is just a mistake and I don't want to push it (have it) in the remote. So I need to know what the change is.

I tried the git diff HEAD..origin/master to see the differences but the problem is that the number of changes are much and I cannot understand what changes (by mistake) I have made in the local master branch.

So, is there any command to see the only changes in my local branch?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Mohsen
  • 971
  • 2
  • 11
  • 29
  • 1
    `git log -1`? `git show -1`? – KamilCuk May 24 '22 at 14:14
  • 1
    Does this answer your question? [Finding diff between current and last version](https://stackoverflow.com/questions/9903541/finding-diff-between-current-and-last-version) – mkrieger1 May 24 '22 at 14:18
  • 2
    Replacing `diff` with `log` command might help, especially if there are more commits between the branches. You can try `git log @{u}..` to see the commits on the local branch that are not on remote, or `git log ..@{u}` to see commits on remote branch your local one does not have. – Krzysiek Karbowiak May 24 '22 at 14:18
  • 1
    Does this answer your question? [How to tell git to show diff of changes I did in last commit?](https://stackoverflow.com/questions/69246694/how-to-tell-git-to-show-diff-of-changes-i-did-in-last-commit) – matt May 24 '22 at 14:21
  • 1
    Your dot syntax is wrong. You mean `git diff origin/master...` That means "show me everything changed on the current branch since it diverged from `origin/master`, which is exactly what you want to know. – matt May 24 '22 at 14:28

0 Answers0