Skip to content

Instantly share code, notes, and snippets.

@jurakovic
Last active January 4, 2025 17:54
Show Gist options
  • Save jurakovic/8c0535b3b8fbc96228de1a94ea910e0d to your computer and use it in GitHub Desktop.
Save jurakovic/8c0535b3b8fbc96228de1a94ea910e0d to your computer and use it in GitHub Desktop.
Script for notes or "changelog" repo (more info here: https://news.ycombinator.com/item?id=42489124)
#!/bin/bash
git status -s
read -p "Press any key to show diff" -n1 -s; echo
git --no-pager diff
read -p "Press any key to stage all files" -n1 -s; echo
git add .
git status -s
read -p "Next: commit, enter message (optional): " msg
git commit -m "$(date '+%Y-%m-%d') $msg"
read -p "Do you want to push? (Y/n) " yn
if [ -z "$yn" ] || [ $yn = "y" ] || [ $yn = "Y" ]; then
git push
else
echo "Skip push"
fi
read -p "Done. Press any key to exit..." -n1 -s; echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment