I successfully created the hook and direct push to master was blocked by the hook.But the at when i try to submit my work i got this error message:
- '/opt/games.git' git repository on storage server is not a bare repository
I’m certain that I created bare repository at /opt/games.git
here is the commands i used :
ssh natasha@ststor01
sudo yum install -y git
git config --global user.email "[email protected]"
git config --global user.name "testuser"
cd /opt/games.git
git init --bare
cp /tmp/update /opt/games.git/hooks/
chmod +x /opt/games.git/hooks/update
cd /usr/src/kodekloudrepos
git clone /opt/games.git games
cd games
git checkout -b xfusioncorp_games
cp /tmp/readme.md .
git add readme.md
git commit -m "Added readme.md"
git push origin xfusioncorp_games
Tried push directly to master to check if it fails due the hook
git checkout -b master
git push origin master