Skip to content

Instantly share code, notes, and snippets.

@sadamczyk
Created March 9, 2024 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sadamczyk/531f8ae3dc92ea87196a4081cda07d59 to your computer and use it in GitHub Desktop.
Save sadamczyk/531f8ae3dc92ea87196a4081cda07d59 to your computer and use it in GitHub Desktop.
Prevent github backlinks in commits
#!/usr/bin/env sh
# Place this file in .git/hooks/commit-msg in a repo you don't want backlinks to happen from.
# This prevents ALL backlinks from commit messages. References in descriptions/comments are obviously not affected.
# Simply replace all github.com links with www.github.com
# https://github.com/orgs/community/discussions/23123#discussioncomment-3239240
sed -i 's|https://github.com|https://www.github.com|g' "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment