My Opinionated Git Conventions
My (very) opinionated Git conventions. If you follow these, you will be much less likely to create messed up git histories, and your git setup will make much more sense.
My (very) opinionated Git conventions. If you follow these, you will be much less likely to create messed up git histories, and your git setup will make much more sense.
A guide on how to setup git commit signing through GPG and GitHub.
Clone a repo with worktrees setup from the start:
mkdir <repo-name>
cd <repo-name>
git clone --bare --filter=blob:none <git-url>
cd <repo-name>.git
Some options to help your sanity:
# always prune on fetch
git config fetch.prune true
# allow `git fetch origin <branch-name>` to work as expected (create a remote ref)
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
To create a new branch:
git worktree add ../<branch-name>
cd ../<branch-name>
To copy a remote branch (note that this will only work with the above fetch config set):
git fetch origin <branch-name>
git worktree add ../<branch-name>
cd ../<branch-name>
To create a new branch based on a remote branch:
git worktree add ../<branch-name> -b <branch-name> --no-track origin/dev
cd ../<branch-name>
Here are some quick conventions for good commit messages and pull request titles.