Skip to content

Instantly share code, notes, and snippets.

@kublaios
Created July 10, 2014 13:08
Show Gist options
  • Save kublaios/127c0cd9d6785953019b to your computer and use it in GitHub Desktop.
Save kublaios/127c0cd9d6785953019b to your computer and use it in GitHub Desktop.
Shell script to add, commit and push changes in a single line of code
git add -A;
git commit -m "$1";
git push origin $2
@kublaios
Copy link
Author

Sample Usage

In the repo directory, call the script by passing commit message as param1 and param2 as branch name.

git.sh "Test commit" kubilay

Output would be:

[kubilay 057fd7a] Test commit
 1 file changed, 1 insertion(+), 1 deletion(-)
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 628 bytes | 0 bytes/s, done.
Total 7 (delta 4), reused 0 (delta 0)
To ...
   2fsdfs6a..057fd7a  kubilay -> kubilay

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