#!/bin/bash
rm -rf hook_pre-receive_*.git
mkdir hook_pre-receive_dest.git
(
cd hook_pre-receive_dest.git
git init --bare
)
cp ../hooks/pre-receive hook_pre-receive_dest.git/hooks/
git clone hook_pre-receive_dest.git hook_pre-receive_src.git
cd hook_pre-receive_src.git
echo "=== Testing push without rights..."
echo "aaa" > a
git add a
git commit -m "a" a
git push origin master
if [ "${?}" != "1" ]; then
echo "Should not work!"
exit 1
fi
echo "=== Testing push with rights..."
export ROCKETGIT_RIGHTS="P"
git push origin master
if [ "${?}" != "0" ]; then
echo "Should work!"
exit 1
fi
cd ..
echo "Rights=${ROCKETGIT_RIGHTS}."
rm -rf hook_pre-receive_*.git
echo "Done!"
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master