{"repo":"kevinoid/git-branch-is","free":true,"listed":false,"github":"https://github.com/kevinoid/git-branch-is","clone":"git clone https://github.com/kevinoid/git-branch-is.git","description":"Assert that the name of the current branch of a git repository has a particular value.","language":"JavaScript","stars":93,"topics":["nodejs","git","cli"],"license":"MIT","category":"cli-tools","readme_excerpt":"git-branch-is =============== Assert that the name of the current branch of a git repository has a particular value. Introductory Example To check that the current branch is named release and print an error if not, run the following command: This can be useful as part of a preversion script in package.json : Installation This package can be installed using npm, either globally or locally, by running: Command Usage The command options are intended to be similar to git and are documented in the --help output: Additional Command Examples Regular Expression Matching To check that the current branch starts with release/ using a regular expression: Note: Be careful to quote patterns to avoid shell expansion or special handling (e.g. POSIX shells expand and cmd.exe treats ^ specially). Case-Insensitive Matching To check that the current branch starts with release/ case-insensitively using a regular expression: Inverted/Negated Matching To check that the current branch is not main , use -I , --invert-match , or --not (all functionally equivalent, use whichever you prefer): API Usage To use the API with a callback function: Alternatively, if a callback is not provided, gitBranchIs will return a Promise : Additionally, instead of a string, a checking function can be passed to perform arbitrary checking against the branch name: API Docs To use this module as a library, see the API Documentation. Rationale What's the value of this command over scripting with git directly? Good question. ","default_branch":null,"files":null,"tree":[],"storefront":"/r/kevinoid","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kevinoid/git-branch-is/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}