i’m trying to push local changes:
git push all
“all” means repo on github and remote server – in my .git/config:
[remote "all"]
url = git@github.com:...myrepo.git
url = ssh://usrname@servername/myrepo.git/
originally it was presumed that nothing should be changed manually on server, but eventually it did happen. however the changes on the server are insubstantial, and i want to override them to have an exact replica of my local repo. so, now i can’t push to the remote server obtaining an error:
remote: error: Your local changes to the following files would be overwritten by merge:
remote: Please, commit your changes or stash them before you can merge.
i am aware of previous answers to similar question, but unfortunately “git push origin –force all” doesn’t work, throwing the same error
please, help! thanks in advance!
Ok it makes perfect sense then. Your remote on your network is not bare. Ie, you work on it; it has it’s own working directory. In fact the branch you are trying to push to is currently checked out. To add, you also have some modifications that are not committed yet. Git will refuse to zap your changes over there.
The proper workflow is to pull the changes from there on the remote.
However, you can also
git clone --bare.