Skip to content

Instantly share code, notes, and snippets.

@isweluiz
Created June 4, 2022 14:57
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 isweluiz/ce9ac5bce972e4cf114a6348da7dccc5 to your computer and use it in GitHub Desktop.
Save isweluiz/ce9ac5bce972e4cf114a6348da7dccc5 to your computer and use it in GitHub Desktop.
### Automating push with just a single bash command
```bash
vim git-push
```
```bash
echo "Enter your message"
read message
git add --all .
git commit -m"${message}"
if [ -n "$(git status - porcelain)" ];
then
echo "IT IS CLEAN"
else
git status
echo "Pushing data to remote server!!!"
git push -u origin master
fi
```
```bash
chmod +x git-push
```
```bash
$ sudo ln -s /home/x/Documents/k8s/ansible-rundeck/git-push.sh /usr/local/bin/git-push
$ git-push
Enter your message
New push-script
[master b51a5b0] New push-script
2 files changed, 12 insertions(+)
create mode 100755 git-push.sh
rename kubernets-nodes-reboot.yml => playbooks/kubernets-nodes-reboot.yml (100%)
IT IS CLEAN
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment