git_template stuff
This commit is contained in:
parent
2d1e60d2c7
commit
e590542f82
@ -15,6 +15,7 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/mas
|
|||||||
rm -rf ~/.bash_aliases
|
rm -rf ~/.bash_aliases
|
||||||
rm -rf ~/.gitconfig
|
rm -rf ~/.gitconfig
|
||||||
rm -rf ~/.gitignore
|
rm -rf ~/.gitignore
|
||||||
|
rm -rf ~/.git_template
|
||||||
rm -rf ~/.hushlogin
|
rm -rf ~/.hushlogin
|
||||||
rm -rf ~/.vim
|
rm -rf ~/.vim
|
||||||
rm -rf ~/.vimrc
|
rm -rf ~/.vimrc
|
||||||
@ -25,6 +26,7 @@ rm -rf ~/.pythonstartup.py
|
|||||||
ln -s $(pwd)/bash_aliases ~/.bash_aliases
|
ln -s $(pwd)/bash_aliases ~/.bash_aliases
|
||||||
ln -s $(pwd)/gitconfig ~/.gitconfig
|
ln -s $(pwd)/gitconfig ~/.gitconfig
|
||||||
ln -s $(pwd)/gitignore ~/.gitignore
|
ln -s $(pwd)/gitignore ~/.gitignore
|
||||||
|
ln -s $(pwd)/git_template ~/.git_template
|
||||||
ln -s $(pwd)/hushlogin ~/.hushlogin
|
ln -s $(pwd)/hushlogin ~/.hushlogin
|
||||||
ln -s $(pwd)/vim ~/.vim
|
ln -s $(pwd)/vim ~/.vim
|
||||||
ln -s $(pwd)/vimrc ~/.vimrc
|
ln -s $(pwd)/vimrc ~/.vimrc
|
||||||
|
4
git_template/hooks/post-checkout
Executable file
4
git_template/hooks/post-checkout
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ -e bin/update_dependencies.sh ]; then
|
||||||
|
bin/update_dependencies.sh
|
||||||
|
fi
|
4
git_template/hooks/post-merge
Executable file
4
git_template/hooks/post-merge
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ -e bin/update_dependencies.sh ]; then
|
||||||
|
bin/update_dependencies.sh
|
||||||
|
fi
|
17
git_template/hooks/pre-push
Executable file
17
git_template/hooks/pre-push
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
protected_branch='master'
|
||||||
|
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
||||||
|
|
||||||
|
if [ $protected_branch = $current_branch ]
|
||||||
|
then
|
||||||
|
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
|
||||||
|
echo
|
||||||
|
if echo $REPLY | grep -E '^[Yy]$' > /dev/null
|
||||||
|
then
|
||||||
|
exit 0 # push will execute
|
||||||
|
fi
|
||||||
|
exit 1 # push will not execute
|
||||||
|
else
|
||||||
|
exit 0 # push will execute
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user