Skip to content

A pre-push hook to prevent using the wrong email when pushing to a specific remote.

Notifications You must be signed in to change notification settings

olivernn/ghostwriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ghostwriter

A git pre-push hook to prevent pushing commits made with a specific author to remote repositories.

Usage

Add to your git config with the host and allowed email address:

[ghostwriter "git.bigcorp.com"]
  email = bob@bigcorp.com
[ghostwriter "github.com"]
  email = bob@example.com

The above will prevent pushes to git.bigcorp.com if any of the commits were not authored by bob@bigcorp.com.

You will need to symlink the build artifact into your repositories .git/hooks directory as pre-push

When pushing you will see something like this:

$ git push
verifying commits to git.bigcorp.com are by Bob with email bob@bigcorp.com
rejecting push due to commits with wrong author:
3b20a8cb7e42d3a08376a7f794eacb5c426ed9bd
error: failed to push some refs to 'https://bob@git.bigcorp.com/bob/WidgetService.git'

Rust

Yes, its probably overkill, but it was more fun than writing a shell script.

About

A pre-push hook to prevent using the wrong email when pushing to a specific remote.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages