I have an account on Dreamhost and they have instructions on using Git to track files in a custom WordPress theme. Their instructions, at, https://help.dreamhost.com/hc/en-us/articles/227816388-Using-Git-with-DreamPress, are the same as many other websites that suggest same. For example, http://git-memo.readthedocs.io/en/latest/deploy.html
You put in an executable script in a bare repo's hooks/post-receive
directory and it calls a git "checkout -f". Here is the example script
#!/bin/sh
GIT_WORK_TREE=/home/user/theme-directory git checkout -f
Here is what I don't understand. Why "checkout -f"? That only changes the name of the branch being tracked, it does not bring it up to date. Shouldn't there be a pull (or fetch) the new content? Does checkout have more power than I undersand?