I'm just learning
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'ssh://firstname.lastname@example.org:2200/home/user'
Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing
git config --list
Untracked files: (use "git add ..." to include in what will be committed)
...(long list of files)
nothing added to commit but untracked files present (use "git add" to track)
$ git push --force origin master
stdin: is not a tty
Counting objects: 3801, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3674/3674), done.
Writing objects: 100% (3801/3801), 6.95 MiB | 37.00 KiB/s, done.
Total 3801 (delta 2450), reused 0 (delta 0)
error: Untracked working tree file 'cacert.pem' would be overwritten by merge.
! [remote rejected] master -> master (Could not update working tree to new HEAD)
error: failed to push some refs to 'ssh://email@example.com:2200/home/'
I don't want the local to import any change from the remote I want local files to overwrite remote files
The provblem is, with that error message, if you don't want to git pull, you need:
git push --force
But that will not just overwrite the files, it will overwrite the recent history of commits on the remote side by your commits, so make sure that is indeed what you want.
the remote has setting
receive.denycurrentbranch=updateInstead. Doesn't that mean that my push should just update the remote master branch?
It allows to push to a non-bare repo (see more here about the "push-to-deploy"), but the error message is not about that.
It is about commits on the remote side that you don't have locally.
pull --rebase, to replay your changes on top of the updated fetched remote branch. Then you push.