2

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.
3
  • did you pull before trying to push? Commented Apr 5, 2016 at 14:22
  • 1
    yes, git also suggest it to you.. look above: hint: (e.g 'git pull') Commented Apr 5, 2016 at 14:25
  • You are working on another branch! (development) Commented Apr 5, 2016 at 14:30

2 Answers 2

2

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
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.