Skip to content

Scripts to configure a git repo with user name and password

License

Notifications You must be signed in to change notification settings

shaleh/setup-git-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Scripts to configure a git repo with user name and password

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages