You are trying to click on a non-bare repo (i.e. a repo with a working tree, just like your local clone), but nothing has been done on the other end to take this into account specifically.
It looks like you are trying to deploy your git push
site. Here's how to do it:
Git gives you to ignore the error message now by running this in a repo on your server:
git config receive.denyCurrentBranch ignore
This says git "I will work, trust me."
Now, if you click, it will update the repo, but the index and working copy will be left untouched. This means that it will always look like you made changes to bring back everything you clicked.
We need a way to update the index and working copy whenever a click occurs. Looks like it's time to ...
Set up a post-receive
hook. Add the .git/hooks/post-receive
file to the server repository:
#!/bin/bash
Please note that this assumes that you always want your tracked changes to be live - everything that you changed directly on the live site will disappear the next time you click (with the exception of unnecessary files, but you should not have one).
I add git status
at the end so that I can see what is on the ground after the push (as it is passed back to the client) - it is especially important that I can catch the irreproducible files and add them to .gitignore
or track them.
Remember to mark post-receive
as executable!
Also: why don't you have files without a trace?
Rollback feature: this is for deploying a live site. If you want to really roll back a failed deployment, you will need everything that comes together to deploy.
This definitely includes the core CMS. Right now, this is only on the server and it is not being tracked, so you have no hope of detecting an error.
Redeployability: if your hard drive of your server goes down, you can unzip the main CMS, re-apply the git repository to it and hope that it works.
The opportunity to notice that it is not tracked by accident: if you have several dozen irreproducible files, and all of them are βdesignedβ in order not to track them, it is easy for a new file to sneak in and get lost in noise.
If your git status
clean by default , then you will see unexpected irreproducible files as soon as they appear.
source share