Git Snippets

Adds Git snippets to README.md
Icons/chart bar
Used 12 times
Created by
D Dale Zak

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/zOvs70"
Template Source

Review the code before running this template on your machine.

inject_into_file 'README.md' do <<~EOF

#### Create Pull Request
```
ISSUE_NAME="123 Fixed A Bug"
BRANCH_NAME=$(echo $ISSUE_NAME | tr '[:upper:]' '[:lower:]' | tr '/' '-' | tr ' ' '-')
git checkout -b $BRANCH_NAME
git add .
git add -u
git commit -m "Fixed a bug for #123"
git push -u origin $BRANCH_NAME
```

#### Create Release Tag
```
TAG_NAME=`date "+%Y-%m-%d_%H-%M-%S"`
git tag -a $TAG_NAME -m $TAG_NAME
git push origin --tags
```
  EOF
end
Comments

Sign up or Login to leave a comment.