Git: non-fast-forward errors
Self-tutoring about computer science: the tutor mentions the idea of a non-fast-forward error in Git.
Let’s imagine two users, Worker1 and Worker2, who are working independently on the same file. Both make changes to it. Worker1 posts their changes, which are adopted (pulled) into the project.
Worker2 has also made changes, some of which don’t fit with those from Worker1. Perhaps Worker1 added more code to a method in the file, while Worker2, on their own copy of it, changed the method in a different way. Since Worker2’s copy of the file was downloaded before Worker1’s changes, Worker2 hasn’t seen them.
When Worker2 goes to upload (push, in GitHub terms) their changes, they will be denied, but given a non-fast-forward error. Such an error explains that, to push their changes, some of the file’s more recent history would be compromised.
In such a case, Worker2 is meant to download the updated file, which includes Worker1’s changes, then make any changes they want to that version of the file. If they disagree with Worker1 about which changes should be made, they need to discuss them with Worker1 and come to a consensus.
Source:
Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.