An open API service indexing awesome lists of open source software.

https://github.com/shaleh/setup-git-repo

Scripts to configure a git repo with user name and password
https://github.com/shaleh/setup-git-repo

automation git hooks

Last synced: 2 months ago
JSON representation

Scripts to configure a git repo with user name and password

Awesome Lists containing this project

README

          

Simple script to setup a git repo. It looks for `~/.config/git/work-settings`
or `~/.config/git/personal-settings` based on the value of `git remote`'s `origin`.

`git-validate-my-config` should be placed in your path before the real git-*
commands. Install it like so:

install -m 755 git-validate-my-config ~/bin
cd ~/bin
ln -s git-validate-my-config git-review

I set up my `~/.gitconfig` like so:

[init]
templatedir = ~/.git-templates

And in there I have a `hooks/pre-commit` that is simply:

#!/bin/sh
git validate-my-config || setup-git

Now whenever I clone a repo the hook is in place and whenever I commit the hook ensures
the configuration is correct and current. `git init` run on a repo that was cloned previously
will safely re-apply the templates.