File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ```
12+
13+ ## Usage
1214
13- If your current branch is ``` dev or uat or qa or master `` `
15+ * If your current branch name is ` EF-803 `
1416
15- ``` commit "New feature" ```
17+ ``` shell
18+ $ commit " New feature"
19+
20+ # translates to
21+ git commit -m " EF-803: New feature"
22+ ```
1623
17- will produce default command
24+ * If your current branch is either of ` dev ` , ` uat ` , ` qa ` , ` staging ` or ` master `
1825
19- ``` git commit -m "New feature" ``` and execute it
26+ ``` shell
27+ $ commit " New feature"
28+
29+ # translates to
30+ git commit -m " New feature"
31+ ```
2032
2133You can create a file ` .ignore ` in your directory to add custom branches you want to ignore. Example ` .ignore ` file:
2234
@@ -26,9 +38,6 @@ sprint-11
2638new-feature
2739```
2840
29- ### Installation
30- Run this command on terminal
31-
32- ``` curl https://raw.githubusercontent.com/sbimochan/smart-commit/master/commit -o /usr/local/bin/commit && chmod +x /usr/local/bin/commit ```
41+ ## License
3342
34- And restart the terminal
43+ [ MIT ] ( LICENSE )
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+
23echo ' Running commit script'
34
45IGNORED_BRANCHES=(" dev" " master" " qa" " uat" " staging" )
2930
3031if [ " $IS_IGNORED " == false ]
3132then
32- echo " Commiting with branch name-> $CURRENT_BRANCH "
33+ echo " Commiting with branch name -> $CURRENT_BRANCH "
3334 eval $COMMIT_WITH_BRANCH
3435else
3536 echo " Commiting with default branch"
You can’t perform that action at this time.
0 commit comments