Skip to content

Instantly share code, notes, and snippets.

@mattcuk
Created March 8, 2022 11:26
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 mattcuk/5f897b80e81845f8efdd82920d4cc3e8 to your computer and use it in GitHub Desktop.
Save mattcuk/5f897b80e81845f8efdd82920d4cc3e8 to your computer and use it in GitHub Desktop.
AutoHotKey script that alerts you if you have changes you need to push for a particular repository
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Loop
{
IfNotExist, c:\winapps\scripts\GitHubNotPushed.out
RunWait %ComSpec% /c "git log --oneline @{upstream}.. > c:\winapps\scripts\GitHubNotPushed.out", c:\your-repo-path\, Hide
IfExist, c:\winapps\scripts\GitHubNotPushed.out
GitPushSize := 0
FileGetSize, GitPushSize, c:\winapps\scripts\GitHubNotPushed.out
if (GitPushSize > 0) {
MsgBox, 48, , You have changes that haven't been pushed for your repo
}
FileDelete, c:\winapps\scripts\GitHubNotPushed.out
Sleep, 60000
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment