Skip to content

Instantly share code, notes, and snippets.

@yudistiraashadi
Last active January 31, 2025 13:46
Show Gist options
  • Save yudistiraashadi/60fd36c7cb8ae9ed3427ab5919d2427f to your computer and use it in GitHub Desktop.
Save yudistiraashadi/60fd36c7cb8ae9ed3427ab5919d2427f to your computer and use it in GitHub Desktop.
Check if pull needed in Git

Check if pull needed in Git

First use git remote update, to bring your remote refs up to date. Then you can do one of several things, such as:

  1. git status -uno will tell you whether the branch you are tracking is ahead, behind or has diverged. If it says nothing, the local and remote are the same.

  2. git show-branch *master will show you the commits in all of the branches whose names end in 'master' (eg master and origin/master).

If you use -v with git remote update (git remote -v update) you can see which branches got updated, so you don't really need any further commands.

@Tskhomelidze
Copy link

Thank you.

@mur4ik18
Copy link

mur4ik18 commented Jul 2, 2024

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment