Git find out the last commit i pushed

I want to find out the last thing that I pushed, not the last thing i commited, but pushed.

Is there a git command for this?

  • Git archive broken after moving from ext3 to FAT and back to ext3
  • Laravel Homestead Installation: bash not working
  • git archive - Multiple gits
  • Debug issue with Git in windows (MsysGit)
  • Do I have to 'git add' a file each time it gets committed?
  • Get latest git tag from the current commit
  • Context:
    I want to squash some commits before merging my dev_branch with a master branch but I have been told you can not rebase anything that is already pushed (is this true?).

    So i would like to know what was the last commit that I cannot include in this rebase.

  • How to create a new git repository with a file that is already in a git repository, keeping the commits
  • Is it possible to access a Github Wiki via SSH?
  • Concurrency in a GIT repo on a network shared folder
  • How can I automatically retain aliases when cloning a git repository?
  • Git SSH public key denied
  • git revert several specific commits
  • One Solution collect form web for “Git find out the last commit i pushed”

    If you mean the last commit you pushed to the master branch then, assuming your remote is origin:

    git rev-parse origin/master

    This will show you the commit ID of the tip of the master branch of the origin origin, as your local repository is currently aware. This may mean that the commit is someone else’s commit, if someone else pushed commits after you did and you have since fetched that branch.

    git show -p origin/master

    This command will give you information about the commit, including the commit ID, author, log message, and diff to its parent commit(s).

    One of my favorite Git commands for doing exactly this kind of inspection:

    git log --pretty=oneline --abbrev-commit --graph --decorate --all

    This will display a nice ASCII-art graph of the commit history, and each commit will show any refs that are targeting it. This way you can, at a single glance, see branches and merges in history and easily see where origin/master is in relation to your own master.

    Git Baby is a git and github fan, let's start git clone.