git shows that all desired directories/files have been successfully committed to my local master branch via:
git ls-tree -r --name-only master
This command git push -u $destination_git_branch $source_git_branch informs me that Everything up-to-date
Problem:
None of my files are actually being written to the destination repo.
Therefore, I double-checked that my git hook post-receive was executable and had the correct directory information:
git --work-tree=/home/username/public_html --git-dir=/home/username/public_html/git/production.git checkout -f
update:
This verifies that the correct repo is targeted by the local git push command:
$ git remote -v
$destination_git_branch ssh_user@123.456.789.12:public_html/git/staging.git (fetch)
$destination_git_branch ssh_user@123.456.789.12:public_html/git/staging.git (push)
Note:
the --git-dir= was incorrect and set for production rather than staging. Therefore, I re-initialized the destination repo with git init --bare and on the local test server I removed, then re-added the remote/destination repo.
Same problem.
The issue seems to be that post-receive isn't being executed. Within post-receive I do have #!/bin/sh and I added exec 5>> /home/adminbvcs/logs/post-receive.log; BASH_XTRACEFD="5"; PS4='$LINENO: '; set -x; in another window I have tail -f /home/username/logs/post-receive.log
Nothing enters the log when I push.
The post-receive is executable:
~/public_html/git/staging.git/hooks$ stat post-receive
File: post-receive
Size: 320 Blocks: 8 IO Block: 4096 regular file
Device: fd04h/64772d Inode: 2228925 Links: 1
Access: (0751/-rwxr-x--x) Uid: ( 1059/username) Gid: ( 1036/username)
Access: 2022-09-19 10:03:39.267891777 +0800
Modify: 2022-09-19 10:02:43.366922815 +0800
Change: 2022-09-19 10:18:55.287857468 +0800
Birth: -
Sure this is a rookie error, but why aren't my files actually being push the correct location?