Skip to content

Commit

Permalink
Merge pull request #1 from adrianotadao/security_commit
Browse files Browse the repository at this point in the history
I added the security parameter to add command
  • Loading branch information
adrianotadao authored Jan 21, 2017
2 parents 91b1380 + 0dca80a commit 7e24d23
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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**
Expand All @@ -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
Expand All @@ -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'
Expand Down
21 changes: 11 additions & 10 deletions lib/git-pc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/git-pc/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class GitPc
VERSION = "0.0.1"
VERSION = "0.0.2"
end

0 comments on commit 7e24d23

Please sign in to comment.