GIT commit Error while pushing to remote repository

0 votes
How can I resolve the below error while commiting my changes to the remote repository

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/gungeajit/demoApp.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.

Regards,

Ajit
May 31, 2020 in Git & GitHub by anonymous
• 120 points
8,009 views

1 answer to this question.

0 votes

Hi@Ajit,

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 first from GitHub and pull all the changes from GitHub to your local repoYou can use below given command before using push command.

$ git fetch

$ git pull origin master
answered Jun 1, 2020 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
1 answer

How to solve the ‘Git commit -a error’?

This happens when no editor is set. ...READ MORE

answered Jul 5, 2018 in Git & GitHub by Tyrion anex
• 8,700 points
2,307 views
0 votes
1 answer

How to add a remote git repository in Jenkins

Follow these steps: Step 1 Go to Manage ...READ MORE

answered May 23, 2019 in Git & GitHub by Alok
13,523 views
0 votes
1 answer

Pushing to Git returning Error Code 403 fatal: HTTP request failed.

Hi@akhtar, Github seems to only support the ssh ...READ MORE

answered Jan 5, 2021 in Git & GitHub by MD
• 95,460 points
10,424 views
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,720 points
8,255 views
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
3,786 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
3,935 views
0 votes
1 answer

How to change the URL for a remote Git repository?

Hi@akhtar, You can use the git remote command ...READ MORE

answered Nov 21, 2020 in Git & GitHub by MD
• 95,460 points
1,050 views
0 votes
1 answer

How to revert a Git repository to a previous commit?

Hi@akhtar, This depends a lot on what you ...READ MORE

answered Dec 21, 2020 in Git & GitHub by MD
• 95,460 points
882 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