Git - necrifede/my-dev-setup GitHub Wiki
Git Hooks
To avoid git hooks. means avoid Husky:
git commit --no-verify and git push --no-verify should work
Git tags
Create a tag and push. before you should be in the commit or branch where you want the tag.
$> git tag -a v1.2.2 -m "new patch version from v1.2.1 to v1.2.2"
$> git push origin v1.2.2
$> git tag -l
Git pull submodules
one of
git submodule update --init --recursive
git submodule update --recursive --remote
git pull --recurse-submodules
stash only staged changes in Git
took from stackoverflow
Double stash
- Stage all your files that you need to stash.
- Run
git stash --keep-index. This command will create a stash with ALL of your changes (staged and unstaged), but will leave the staged changes in your working directory (still in state staged). - Run
git stash push -m "good stash" - Now your
"good stash"has ONLY staged files.
Now if you need unstaged files before stash, simply apply first stash (the one created with --keep-index) and now you can remove files you stashed to "good stash".
from Git 2.35 (Q1 2022)
git stash push --staged