Apologies for the double post, but I wasn't getting any further replies in my previous question, so thought I'd try my luck explaining it better ...
I've set my git working structure as follows (thanks to a recommendation in another question git : Small project work)
/live/website
|
|
/path/to/staging (bare)
| |
| |
dev1 dev2
Currently, both dev1 and dev2, push the projects to the /path/to/staging repo
. I have a hook in /path/to/staging, that automatically triggers a cd /live/website && git pull
from my /path/to/staging. This way, I have a working copy of all files there. So really dev1, dev2 and /live/website are git clones of /path/to/staging.
Rudi, recommended finding out if receive.denyNonFastforwards was set to true on path/to/staging
by doing:
cd path/to/staging/ && git config --get-all receive.denyNonFastforwards
And unfortunately it is set to true. So for example if I did a git reset --hard <SHA-1>
on the /live/website server, it does so successfully. However, when I try to push my changes from /live/website to /path/to/staging:
error: failed to push some refs to '/path/to/staging/' To prevent you from losing history, non-fast-forward updates were rejected. Merge the remote changes before pushing again. See the 'non-fast-forward'
Assumably, I face the same problem when I make the changes within dev1 or dev2 and try to push the changes to /path/to/staging.
I want to have a kind of master reset where I could just log onto /path/to/staging
or /live/website
and step-down to a stable version instead of figuring out which developer made the change and then doing a git reset. Can this be done? I basically want to have the ability to step down to a different version of a file, if I choose to do so ...
git revert
) for the faulty commits, to get back to a good state. using reset sounds like an awfully bad workflow