diff --git a/README.md b/README.md index 857e36b..1934644 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ###Git shortcut to automate the commit and push commands -Sometimes executing basic git commands is much boring and repetitive so, this shortcut will help you a lot. It will run these commands in this sequence: +Sometimes executing basic git commands is very boring and repetitive so, this shortcut will help you a lot. It will run these commands in this sequence: - `git status` -- `git commit -am"YOUR_MESSAGE_COMMIT"` +- `git commit -S -am"YOUR_MESSAGE_COMMIT"` - `git push origin YOUR_CURRENT_BRANCH` **The Script** @@ -18,7 +18,7 @@ echo -e "$(tput setaf 2)** Executing Status command$(tput sgr0)" git status echo -e "$(tput setaf 2)\n** Executing commit command$(tput sgr0)\n" -git commit -am"$COMMIT_MESSAGE" +git commit -S -am"$COMMIT_MESSAGE" echo -e "$(tput setaf 2)\n** Executing push command$(tput sgr0)\n\n" git push origin $CURRENT_BRANCH @@ -34,7 +34,7 @@ $ gem install git-pc **Usage:** -At some git repository, just run: +Access some git repository and now you just run: ```bash git pc 'Message Commit' diff --git a/lib/git-pc.rb b/lib/git-pc.rb index 97fc9c5..402bae0 100644 --- a/lib/git-pc.rb +++ b/lib/git-pc.rb @@ -23,27 +23,28 @@ def status_command %x(git status) end - def push_command - puts "Executing push command".green - puts "git push origin #{ current_branch }".yellow + def add_command + puts "Executing add command".green + puts "git add .".yellow puts - %x(git push origin #{ current_branch }) + %x(git add .) end def commit_command puts "Executing commit command".green - puts "git commit -m #{ message }".yellow + puts "git commit -S -am #{ message }".yellow puts - %x(git commit -m "#{ message }") + %x(git commit -S -am "#{ message }") end - def add_command - puts "Executing add command".green - puts "git add .".yellow + def push_command + puts "Executing push command".green + puts "git push origin #{ current_branch }".yellow puts - %x(git add .) + %x(git push origin #{ current_branch }) end + def current_branch @current_branch ||= repo.head.name end diff --git a/lib/git-pc/version.rb b/lib/git-pc/version.rb index 43ee4e2..8ba7e88 100644 --- a/lib/git-pc/version.rb +++ b/lib/git-pc/version.rb @@ -1,3 +1,3 @@ class GitPc - VERSION = "0.0.1" + VERSION = "0.0.2" end