https://github.com/captainhook-git/examples-bin
Repository with lots of example branches to demo the CaptainHook functionality
https://github.com/captainhook-git/examples-bin
Last synced: 4 months ago
JSON representation
Repository with lots of example branches to demo the CaptainHook functionality
- Host: GitHub
- URL: https://github.com/captainhook-git/examples-bin
- Owner: captainhook-git
- License: mit
- Created: 2023-11-19T21:54:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T08:09:11.000Z (about 2 years ago)
- Last Synced: 2025-06-22T01:03:23.483Z (7 months ago)
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CaptainHook Examples
Repository with lots of example branches to demo the CaptainHook functionality. Clone the repository and then activate the
Captain.
```
$ git clone git@github.com:captainhook-go/examples.git & cd examples
$ captainhook install -f
```
- [git-notify notifications](#git-notify-functionality)
- [inject issue key from branch](#inject-issue-key-from-branch)
- [block fixup and squash commits](#block-fixup-and-squash-commit-from-being-pushed)
## git-notify functionality
Checkout the first branch.
```
$ git switch action/git-notify-checkout-first
```
If you update your working directory with `merge`, `rebase`, `checkout` and any commit contains `git-notify:` followed by a message the message will be displayed.
```
$ git switch action/git-notify-checkout-second
```
## inject issue key from branch
Checkout the demo branch.
```
$ git switch action/inject-key-from-branch-PROJ-12345
```
Add a new file, and commit it to the repository
```
$ touch demo
$ git add demo
$ git commit
```
Your editor should already contain the `PROJ-12345` issue key extracted from the branch name.
## block fixup! and squash! commit from being pushed
Start by checking out the starting branch.
```
$ git switch action/prevent-push-fixup+squash
```
Merge a prepared fixup! commit.
```
$ git merge action/prevent-push-fixup+squash-fix
```
If you try to push the changes the push should fail.
```
$ git push
```