Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Push to origin/master was rejected

MBugOnYou July 31, 2018

Hello I am new to bitbucket. I created a repository in bitbucket and wanna upload android project. but i see an error "Push to origin/master was rejected". can you tell me how to solve this problem?

1 answer

0 votes
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 31, 2018

What else does it say? The server generally explains what the specific problem is.

MBugOnYou July 31, 2018

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Like salimec likes this
MBugOnYou July 31, 2018

Can't Update
No tracked branch configured for branch master or the branch doesn't exist.
To make your branch track a remote branch call, for example,
git branch --set-upstream-to origin/master master (show balloon)

jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 31, 2018

So there are two things going on here:

1. You've defined the local branch but not the way it corresponds to the version on origin. The suggested command should fix that.

2. You're working on master, but the version of master you have is not the same as the one on the repo you're trying to push to. You need to run git pull before you run git push - or you can use a different branch for development and save the master branch for "good" code.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events