Skip to content
msh31Public

About

[mirror] A git pre-push hook that stops identity leaks before leaving your machine

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

git-id

A simple hook for git that stops you from pushing commits that use the wrong identity

Windows FreeBSD macOS


What is this?

git-id is a pre-push hook that blocks outgoing commits by checking the author and committer emails of against the owner of the repository in the remote URL.

Example: You define my-org: org@example.com in your config. You commit with me@personal.com and push to github.com/my-org/repo. git-id lists the outgoing author mails and blocks the push until you fix the identity

Warning

This does NOT hide your account from GitHub's activity feed, which shows who pushed


Build

The only commands you need are:

cmake -B build
cmake --build build/

However, on FreeBSD you must use Ninja and set it using EXPORT CMAKE_GENERATOR=Ninja in your shell/profile

Install

Simply run git-id install within a repository and the hook will be installed automatically!

You may also want to enforce this globally, in which case you can simply pass the --global flag to the previous command.

Note

Applying this globally will prevent any pre-existing hooks from running

Usage

  1. Create a config here: ~/.git-identities
  2. Setup your identities, an example entry looks like this:
    owner1|owner2: user@mail.com, user@second-mail.com
  3. Use git and once a mis-match occurs, the hook will catch it

Troubleshooting

  • How do I bypass this hook?
    • You can simply run git push --no-verify and the hook will be skipped

About

[mirror] A git pre-push hook that stops identity leaks before leaving your machine

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages