Skip to content

Instantly share code, notes, and snippets.

@Stovoy
Created November 18, 2025 19:20
Show Gist options
  • Select an option

  • Save Stovoy/7751373f1bf5193327dfbdb8817180dd to your computer and use it in GitHub Desktop.

Select an option

Save Stovoy/7751373f1bf5193327dfbdb8817180dd to your computer and use it in GitHub Desktop.
import subprocess
import sys
def main() -> int:
result = subprocess.run(["git", "status"], capture_output=True, text=True)
if result.stdout:
sys.stdout.write(result.stdout)
if result.stderr:
sys.stderr.write(result.stderr)
return result.returncode
if __name__ == "__main__":
raise SystemExit(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment