While this is rather old it is extremely discouraged to push to a working tree.
https://git.wiki.kernel.org/index.php/GitFaq#Unexpected_behavior
A better method would be to create a bare repo mirroring the website's working tree.
All a bare repo is, is a repository with no working tree or rather with no files checked out. The hierarchy exists all things considered and can be checked out.
In otherwords, it acts as a host for changes only.
Without knowing the directory hierarchy you are working with for your web, I am going to assume it is a standard website layout using chrooted home
EG: /home/user/www
On the server using ssh with git installed:
Create a working tree of the current site
cd /home/user/public_html
git init
git add .
git commit -m "Initial Commit"
Create a bare repository to remote push to from your local system
mkdir /home/user/deploy.git
cd /home/user/deploy.git
git init --bare
Link your working tree repository and your bare deploy repository
cd /home/user/public_html
git remote add deploy /home/user/deploy.git
git remote show deploy
* remote deploy
URL: /home/user/deploy.git
git push deploy master
Now set up a new repo on your local system
git clone ssh://user@example.com/home/user/deploy.git
git branch -a
*master
remotes/origin/HEAD
remotes/origin/master
Now we setup 2 hooks to instantly make changes to your web remote repo when you push to it or if someone else you give access to pushes to it. Since git config receive.denyCurrentBranch ignore will lead to trouble in the long run
On the remote server enable post-update for deploy
cd /home/user/deploy.git/hooks
mv post-update.sample post-update
vi post-update
Change your post-update hook to the below and save
#!/bin/sh
echo "Pulling changes into public_html [deploy post-update]"
cd /home/user/public_html || exit
unset GIT_DIR
git pull deploy master
exec git update-server-info
Now we set up your web working tree to push its changes to deploy if something is committed to it.
cd /home/user/public_html/.git/hooks
mv post-commit.sample post-commit
vi post-commit
Then change post-commit hook to the following
#!/bin/sh
echo "Pushing changes to deploy [public_html post-commit]"
git push deploy
You still have the option to checkout your web working tree if you need to.
This will let you pull your changes from deploy to your web's working tree when you push your local system's master.
You can branch, rebase, revert, etc without affecting your web's working tree, without worrying about conflict markers, by instead just using the bare deploy repository.
If you need more control over what's committed you can use post-receive instead of or in conjunction with post-update.
Hope this helps someone else looking to do the same as the OP.