How to deal with non-fast forward errors?

0 votes
Jul 2, 2018 in Other DevOps Questions by Tyrion anex
• 8,270 points
2,084 views

1 answer to this question.

0 votes

This error is faced when git cannot commit your changes to the remote repository. This may happen because your commit was lost or if someone else is trying to push to the same branch as you. This is the error you face.

$ git push origin master

To https://github.com/USERNAME/REPOSITORY.git

! [rejected]   master -> master (non-fast-forward)

error: failed to push some refs to 'https://github.com/USERNAME/REPOSITORY.git'

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes (e.g. 'git pull') before pushing again.  See the

'Note about fast-forwards' section of 'git push --help' for detail

This can be fixed by fetching and merging the changes made on the remote branch with the changes that you have made locally. Run the following commands to fetch and merge.

$ git fetch origin

This command fetches the updates made to a remote repository.

$ git merge origin YOUR_BRANCH_NAME

This command merges the updates made online with your local work.

answered Jul 3, 2018 by Sophie may
• 9,530 points

Related Questions In Other DevOps Questions

0 votes
1 answer

How to get issues count based on rules in a sonar project?

There are API docs in the footer ...READ MORE

answered May 4, 2018 in Other DevOps Questions by DareDev
• 6,810 points
313 views
0 votes
1 answer

How to get results of SonarQube?

You can use sonarqube quality gates which ...READ MORE

answered Jun 8, 2018 in Other DevOps Questions by ajs3033
• 7,280 points
584 views
0 votes
1 answer

SonarQube cannot connect to JIRA 7 with REST API

The JIRA Plugin is not compatible with JIRA 7 ...READ MORE

answered Jul 5, 2018 in Other DevOps Questions by Kalgi
• 40,420 points
66 views
0 votes
1 answer

how to check runtime for chef-client executions?

 Chef doesn't have the mechanism to save ...READ MORE

answered Jul 5, 2018 in Other DevOps Questions by DareDev
• 6,810 points
31 views
0 votes
1 answer
0 votes
1 answer

How to get the most recent ebs snapshot using terraform datasource?

It's not available in the latest release ...READ MORE

answered Jul 8, 2018 in Other DevOps Questions by Atul
• 10,240 points
228 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
145 views
0 votes
1 answer