git hooks for Go projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Martin Thielecke cc9ca58a85
fix paths
6 months ago
general filepath love 7 years ago
githook-gobuild fix paths 6 months ago
githook-gofmt fix paths 6 months ago
githook-gotest fix paths 6 months ago
.gitignore added binary 7 years ago
LICENSE Initial commit 7 years ago
README.md removed space at end of line (copy & paste is now possible ;)) 7 years ago
go.mod fix paths 6 months ago
go.sum fix paths 6 months ago
main.go fix paths 6 months ago

README.md

git-hooks

Collection of git hooks. Most of the pre-commit hooks are Go specific.

usage

  • to install the hooks use:

    go get github.com/mthie/git-gohooks
    go get github.com/mthie/git-gohooks/githook-gobuild
    go get github.com/mthie/git-gohooks/githook-gofmt
    go get github.com/mthie/git-gohooks/githook-gotest
    
  • on a Unix based system symlink it with

    ( cd .git/hooks && \
      ln -s $GOPATH/bin/git-gohooks pre-commit && \
      ln -s $GOPATH/bin/githook-gofmt pre-commit_01_gofmt && \
      ln -s $GOPATH/bin/githook-gobuild pre-commit_02_gobuild && \
      ln -s $GOPATH/bin/githook-gotest pre-commit_03_gotest )
    
  • on a Windows system in a command shell with Administrator privileges

    cd .git\hooks
    mklink /H pre-commit <YourGoPath>\bin\git-gohooks.exe
    mklink /H pre-commit_01_gofmt.exe <YourGoPath>\bin\githook-gofmt.exe
    mklink /H pre-commit_02_gobuild.exe <YourGoPath>\bin\githook-gobuild.exe
    mklink /H pre-commit_03_gotest.exe <YourGoPath>\bin\githook-gotest.exe