@@ -16,7 +16,7 @@ run the following command:
1616
1717```
1818$ git-branch-is release
19- Error: Current branch is "master ", not "release".
19+ Error: Current branch is "main ", not "release".
2020$ echo $?
21211
2222```
@@ -75,7 +75,7 @@ expression:
7575
7676```
7777$ git-branch-is -r "^release/"
78- Error: Current branch "master " does not match "^release/".
78+ Error: Current branch "main " does not match "^release/".
7979$ echo $?
80801
8181```
@@ -90,19 +90,19 @@ using a regular expression:
9090
9191```
9292$ git-branch-is -i -r "^release/"
93- Error: Current branch "master " does not match "^release/".
93+ Error: Current branch "main " does not match "^release/".
9494$ echo $?
95951
9696```
9797
9898### Inverted/Negated Matching
9999
100- To check that the current branch is not ` master ` , use ` -I ` , ` --invert-match ` ,
100+ To check that the current branch is not ` main ` , use ` -I ` , ` --invert-match ` ,
101101or ` --not ` (all functionally equivalent, use whichever you prefer):
102102
103103```
104- $ git-branch-is --not master
105- Error: Current branch is "master ".
104+ $ git-branch-is --not main
105+ Error: Current branch is "main ".
106106$ echo $?
1071071
108108```
@@ -113,9 +113,9 @@ To use the API with a callback function:
113113
114114``` js
115115var gitBranchIs = require (' git-branch-is' );
116- gitBranchIs (' master ' , function (err , result ) {
116+ gitBranchIs (' main ' , function (err , result ) {
117117 if (err) console .error (err);
118- else console .log (result ? ' On master ' : ' Not on master ' );
118+ else console .log (result ? ' On main ' : ' Not on main ' );
119119});
120120```
121121
@@ -124,8 +124,8 @@ Alternatively, if a callback is not provided, `gitBranchIs` will return a
124124
125125``` js
126126var gitBranchIs = require (' git-branch-is' );
127- gitBranchIs (' master ' ).then (
128- function (result ) { console .log (result ? ' On master ' : ' Not on master ' ); },
127+ gitBranchIs (' main ' ).then (
128+ function (result ) { console .log (result ? ' On main ' : ' Not on main ' ); },
129129 function (err ) { console .error (err); }
130130);
131131```
@@ -135,8 +135,8 @@ perform arbitrary checking against the branch name:
135135
136136``` js
137137var gitBranchIs = require (' git-branch-is' );
138- gitBranchIs (function (branchName ) { / ^ master $ / .test (branchName); }).then (
139- function (result ) { console .log (result ? ' On master ' : ' Not on master ' ); },
138+ gitBranchIs (function (branchName ) { / ^ main $ / .test (branchName); }).then (
139+ function (result ) { console .log (result ? ' On main ' : ' Not on main ' ); },
140140 function (err ) { console .error (err); }
141141);
142142```
0 commit comments