Skip to content

Instantly share code, notes, and snippets.

@brettmillerb
Last active January 18, 2019 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettmillerb/af188aa30048e18eceaa72390e816bf5 to your computer and use it in GitHub Desktop.
Save brettmillerb/af188aa30048e18eceaa72390e816bf5 to your computer and use it in GitHub Desktop.
Git commands

Contents

See commits which have not been synchronised

$ git log origin/master..HEAD

commit 5f6eccf172df05c9409a6d693a926734de8bc3ff (HEAD -> dev, origin/dev)
Author: Brett Miller <brett@millerb.co.uk>
Date:   Wed Oct 24 23:25:04 2018 +0100

    Adding WhatIf Support

commit 096a9233c7a4e5104e5879474a0ecf2f1346a8c1
Author: Brett Miller <brett@millerb.co.uk>
Date:   Wed May 23 22:22:06 2018 +0100

    Added image parameter as scriptblock, probably needs to be reworked as an array of uri strings not scriptblock

See how many commits your branch is behind master

$ git rev-list --left-right --count master..dev
0       2

Git Log alias

$ git config --global alias.logline "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
$ git logline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment