I am trying to create a file remotely via ssh with the command as follows:
ssh $REMOTE_USER@$REMOTE_HOST "
cat > hooks/post-receive <<EOF
#!/bin/bash
git checkout -f
EOF
chmod +x hooks/post-receive
"
After it is successfully executed when I check the file with cat repo.git/hooks/post-receive
on remote server I see the following result:
#!/bin/bash
git checkout -f
EOF
chmod +x hooks/post-receive
I expect EOF
and chmod +x hooks/post-receive
not to be present in post-receive
file.
What can be done to solve this.