Add commit variants

This commit is contained in:
Isabelle Viktoria Maciohsek
2021-04-04 20:55:26 +03:00
parent 933f0a40e3
commit 2c0ba554cd
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,19 @@
---
title: Commit without running git hooks
tags: commit,intermediate
---
Creates a new commit skipping the pre-commit and commit-msg hooks.
- Use `git commit --no-verify -m <message>` to commit staged changes without running git hooks.
```sh
git commit --no-verify -m <message>
```
```sh
# Make some changes to files, ones that your precommit hook might not allow
git add .
git commit --no-verify -m "Unsafe commit"
# Creates a commit with the message "Unsafe commit", without running git hooks
```