Reputation: 2056
I've created a file in a branch, merge it to master OK, But I have an error pushing:
>git push origin master
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/
stash/scm/tdk-apps/tdk-admin-app.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
This is the >git status:
# On branch development
nothing to commit, working directory clean
This is the >git pull
Password for 'https://[email protected]/':
Already up-to-date.
Upvotes: 2
Views: 87
Reputation: 764
It appears your changes are not in sync with the remote repository.
git pull
If there are any conflicts you will need to resolve them. Otherwise you will be able to push.
You can also overwrite a remote branch if you are sure that the remote changes are not changes you wish to keep.
git push origin +development
In this case the "+" forces an override.
I would not recommend forcing an update when working in a team environment however as you would potentially be deleting other developers changes.
Upvotes: 0
Reputation: 11337
Assume you are working on branch 'development' - Try to pull before push. Also suggested in hint:
git pull origin development
then:
git push origin development
Upvotes: 2