Conventional Commits

From the specs: <type>[optional scope]: <description> [optional body] [optional footer(s)] Types fix: build: chore: ci: docs: style: refactor: perf: test: Examples feat!: send an email to the customer when a product is shipped Relation to Semver fix type commits should be translated to PATCH releases. feat type commits should be translated to MINOR releases. Commits with BREAKING CHANGE in the commits, regardless of type, should be translated to MAJOR releases.

March 1, 2023 · 70 words · Peter Dieleman

Git reset to single commit

Resetting entire repository to a single commit: git checkout --orphan newBranch git add -A # Add all files and commit them git commit -m "first commit" git branch -D main # Deletes the main branch git branch -m main # Rename the current branch to main git push -f origin main # Force push main branch to github git gc --aggressive --prune=all # remove the old files And additionally check remote branches: git ls-remote or delete them through the UI....

February 1, 2023 · 92 words · Peter Dieleman

Git Commands

The Nuclear Option git clean -xdf Pull rebase For current repository: git config pull.rebase true As a global setting: git config --global pull.rebase true https://coderwall.com/p/tnoiug/rebase-by-default-when-doing-git-pull Fix wrong rebase git rebase --abort git rebase --quit git am --resolved git am --abort See: https://www.specbee.com/blogs/how-create-and-apply-patch-git-diff-and-git-apply-commands-your-drupal-website Pruning branches from remote list git remote update origin --prune Purging Secrets from Repo Use git-filter-repo or BFG repo cleaner: https://www.specbee.com/blogs/how-create-and-apply-patch-git-diff-and-git-apply-commands-your-drupal-website Guides: https://improveandrepeat.com/2021/06/how-to-use-git-filter-repo-to-remove-files-from-your-git-repository/ https://peterbabic.dev/blog/clever-uses-for-git-filter-repo/ https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository Automatically Rewriting Git url to use SSH instead of HTTPS git config --global --add url....

February 1, 2022 · 83 words · Peter Dieleman