I am writing a gitosis
post-push hook for a central repository
which retrieves updates from the central repository to test the environment
nano /var/git/repositories/holding.git/hooks/post-update
#!/bin/bash cd /var/vh/holding; git reset --hard; git checkout testing; git pull;
here is what i get after clicking on my client (VM development)
# blah ... Counting objects: 57, done. Compressing objects: 100% (24/24), done. Writing objects: 100% (30/30), 3.42 KiB, done. Total 30 (delta 18), reused 0 (delta 0) fatal: Not a git repository: '.' fatal: Not a git repository: '.' fatal: Not a git repository: '.' fatal: Not a git repository: '.' To git@cheby.ru :holding.git 233b5a2..0f46cd8 testing -> testing
Obviously, my attempt to tell git where it should do pull failed.
What is the correct way to run the git command for the specified working copy in a bash script?
jonny source share