Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
### 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