Cannot push to GitHub - keeps saying need merge

0 votes

Hi Guys,

I am new to Github. I am trying to push my code to Github. But it is showing me the below error.

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:519ebayproject/519ebayproject.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Jan 4, 2021 in Git & GitHub by akhtar
• 38,260 points
4,008 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the git pull origin master command before you push anything. I assume that you are using the origin as a name for your remote. You need to pull before the push, to make your local repository up-to-date before you push something (just in case someone else has already updated code on github.com). This helps in resolving conflicts locally.

answered Jan 4, 2021 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
1 answer

I am not able to use pull, push, branch merge

Please execute the below command in the ...READ MORE

answered May 23, 2019 in Git & GitHub by Umer
642 views
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,890 points
2,456 views
0 votes
1 answer

Trying to analyse Sonarqube from Drone.io in Github PRs

Just try the below steps.The DRONE_PULL_REQUEST environment variable has ...READ MORE

answered Jun 27, 2018 in Git & GitHub by shubham
• 7,340 points
1,196 views
0 votes
1 answer

How to perform a sonarqube analysis from drone.io in github?

DRONE_PULL_REQUEST  env variable holds the pull request ...READ MORE

answered Jul 6, 2018 in Git & GitHub by DareDev
• 6,890 points
2,602 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
0 votes
1 answer

How merge works in Git & GitHub!!!??

Hi@Hasid, In Git & GitHub merge concept comes ...READ MORE

answered Jan 31, 2020 in Git & GitHub by MD
• 95,460 points
815 views
+1 vote
1 answer

why we need to add at staging area before commit??

Hi@akhtar, The staging area is like a rough draft space, ...READ MORE

answered Jul 19, 2020 in Git & GitHub by MD
• 95,460 points
727 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP