Skip to content

Commit 2336cdc

Browse files
authored
Merge pull request #7 from mesaugat/patch-1
Cleanup README.md
2 parents c091d4b + 6373a02 commit 2336cdc

2 files changed

Lines changed: 27 additions & 16 deletions

File tree

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
1-
## Smart commit
2-
Create commit with current branch name
1+
# Smart Commit
32

4-
For example:
5-
If your current branch name is ```EF-803```
3+
Create a commit prefixed with the current branch name.
64

7-
```commit "New feature"```
5+
## Installation
86

9-
will produce command
7+
Run this command on terminal.
108

11-
```git commit -m "EF-803: New feature"``` and execute it
9+
```shell
10+
curl https://raw.githubusercontent.com/sbimochan/smart-commit/master/commit -o /usr/local/bin/commit && chmod +x /usr/local/bin/commit
11+
```
1212

13-
If your current branch is ```dev or uat or qa or master```
13+
## Usage
1414

15-
```commit "New feature"```
15+
* If your current branch name is `EF-803`
1616

17-
will produce default command
17+
```shell
18+
$ commit "New feature"
1819

19-
```git commit -m "New feature"``` and execute it
20+
# translates to
21+
git commit -m "EF-803: New feature"
22+
```
2023

21-
### Installation
22-
Run this command on terminal
24+
* If your current branch is either of `dev`, `uat`, `qa`, `staging` or `master`
2325

24-
```curl https://raw.githubusercontent.com/sbimochan/smart-commit/master/commit -o /usr/local/bin/commit && chmod +x /usr/local/bin/commit```
26+
```shell
27+
$ commit "New feature"
2528

26-
And restart the terminal
29+
# translates to
30+
git commit -m "New feature"
31+
```
32+
33+
## License
34+
35+
[MIT](LICENSE)

commit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
2+
23
echo 'Running commit script'
4+
35
CURRENT_BRANCH_CMD="git rev-parse --abbrev-ref HEAD"
46
CURRENT_BRANCH=$(eval $CURRENT_BRANCH_CMD)
57

@@ -8,7 +10,7 @@ DEFAULT_COMMIT="git commit -m \"$1\""
810

911
if [ "$CURRENT_BRANCH" != "dev" ] && [ "$CURRENT_BRANCH" != "master" ] && [ "$CURRENT_BRANCH" != "qa" ] && [ "$CURRENT_BRANCH" != "uat" ] && [ "$CURRENT_BRANCH" != "staging" ]
1012
then
11-
echo "Commiting with branch name-> $CURRENT_BRANCH"
13+
echo "Commiting with branch name -> $CURRENT_BRANCH"
1214
eval $COMMIT_WITH_BRANCH
1315
else
1416
echo "Commiting with default branch"

0 commit comments

Comments
 (0)