I am trying to create a BASH shell script that runs through SSH on my shared hosting account to automate the git website control system detailed in:
http://danielmiessler.com/study/git/#website.
So far my bash script is right out of the above article:
cd ~/mydomains; mkdir $name.git;
cd ~/mydomains/$name.git; git init --bare;
/bin/vi ~/domains/$name.git/hooks/post-update
The first 2 lines work as expected.
when I add the third line the script seems to freeze up. the path to vi is /bin/vi in my environment.
Directly from the article I want the to perform the following:
vi /path/website.git/hooks/post-update
then insert:
GIT_WORK_TREE=/path/htdocs git checkout -f
Then close the file.
Could anyone offer me some advice on what to do now?
vi? Doesecho 'GIT_WORK_TREE=/path/htdocs git checkout -f' >> /path/website.git/hooks/post-updatenot suffice?