master - master non-fast-forward error failed to push some refs to git github com abc70 new git

+1 vote

Hi,

I am getting the below error when trying to push data from local to GitHub. How can I solve this error?

! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:abc70/new.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Feb 14, 2020 in Git & GitHub by akhtar
• 38,260 points
20,113 views

1 answer to this question.

0 votes

Hi@akhtar,

To update your local repo to GitHub you used git push command. But if there are any changes occur in GitHub, at that situation you have to fetch your data from GitHub and pull all the changes from GitHub. You can use the below command before using push command.

$ git fetch

$ git pull origin master
answered Feb 14, 2020 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
1 answer

git error: failed to push some refs to remote

I would advise using: git pull --rebase git push The ...READ MORE

answered May 2, 2022 in Git & GitHub by narikkadan
• 63,600 points
8,372 views
0 votes
1 answer
+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
+2 votes
3 answers
+1 vote
1 answer
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