Skip to content

Instantly share code, notes, and snippets.

@SauloSilva
Last active October 18, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SauloSilva/11216740 to your computer and use it in GitHub Desktop.
Save SauloSilva/11216740 to your computer and use it in GitHub Desktop.
git pc
#!/bin/bash
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
COMMIT_MESSAGE=$1
echo -e "$(tput setaf 2)** Executing Status command$(tput sgr0)"
git status
echo -e "\n$(tput setaf 2)\n** Executing add command$(tput sgr0)"
git add .
echo -e "$(tput setaf 2)\n** Executing commit command$(tput sgr0)\n"
git commit -a -m"[$CURRENT_BRANCH] $COMMIT_MESSAGE"
echo -e "$(tput setaf 2)\n** Executing push command$(tput sgr0)\n\n"
git push origin $CURRENT_BRANCH
@SauloSilva
Copy link
Author

Creating

sudo vim /bin/git-pc
sudo chmod +x /usr/local/bin/git-pc

Usage

git pc 'message'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment