Say I am working with multiple remotes:
$ git remote -v
origin https://github.com/ettie62/Quicke(fetch)
origin https://github.com/ettie62/Quicke(push)
public https://github.com/roslyn80/Quicke(fetch)
public https://github.com/roslyn80/Quicke(push)
with each remote having multiple branches:
$ git branch -a
* master
refactor
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/refactor
remotes/public/dev
remotes/public/master
How can I run the following pre-push hook only when attempting to push to a certain branch of a certain remote, e.g. public/master
, but not run it when pushing to say origin/master
:
"husky": {
"hooks": {
"pre-push": "CI=true npm test"
}
},