Push from local to remote problem

NewBee to GIT
On branch Version2.0
Your branch is ahead of ‘origin/Version2.0’ by 3 commits.
(use “git push” to publish your local commits)

When doing the git push I am getting:
qa-3pthinc@bafo.no@qa-sxd6e-013’s password:
Enumerating objects: 79, done.
Counting objects: 100% (62/62), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (31/31), 6.37 KiB | 543.00 KiB/s, done.
Total 31 (delta 27), reused 0 (delta 0)
To ssh://qa-sxd6e-013/GITrepos/bafo
! [remote rejected] Version2.0 -> Version2.0 (Working directory has unstaged changes)
error: failed to push some refs to ‘ssh://qa-3pthinc%40bafo.no@qa-sxd6e-013/GITrepos/bafo’

How to fix this? Do I have to rebuild my workspace?

That looks like the remote isn’t a bare repository, and files have been changed there. So git refuses the push to not destroy any work on the remote side. See the documentation for the receive.denyCurrentBranch option for the rationale and alternatives. But most likely the solution is to check what and why change on the remote system and then decide what you want to do. :wink:

For us that is not very comfy using GIT… what are the alternatives?

We are three developers that uses this GIT repository, but to be honest, we pray to … that it works swell… and now it does not…

That really depends on how you’re using that remote repository. Is it just to share code between the three of you, or something else?

We made it… by tracing what files that had mistakes… thanks

1 Like