Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+16 votes

I didn't get the merge conflict message. Instead i got this

Updating 2fa06e8..0ec9e04
Fast-forward
SelfConflictTestProject/src/RestaurantMenu.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

someone guide me ?

asked in CSC305 Fall 2022 by (1.1k points)

2 Answers

+5 votes

In general, fast-forward isn't an error -- it's usually a sign that things are going smoothly.

A "fast-forward" merge happens when you pull, but there aren't any locally committed changes to merge. Thus, your local repo can simply add any commits you just pulled from the remote (GitHub), and tack them onto the end of the local HEAD branch, and move HEAD to point to the latest commit. (Kind of like fast-forwarding to the end of a movie.)

However, in the case of Lab 4, we don't want things to go smoothly, because we are trying to create conflicts, so that we can learn how to resolve them.

Since your pull worked without giving you any error, it sounds like you may have missed the steps where you made changes to your local RestaurantMenu.java, and added/committed those changes. OR, you may have made your local changes, but maybe you pushed them up to GitHub BEFORE you edited the file on GitHub, so then when you pulled you just received the updates.

What I would recommend is that you try again to make some changes to both the local RestaurantMenu.java and the remote (GitHub) RestaurantMenu.java. Make sure you add/commit your local changes as well, and then try to pull. Hopefully you will see the CONLICTED file error message next time!

answered by (508 points)
–4 votes

A fast-forward error occurs when a push would revert commits to the repository. In my groups case, we were getting them when we forgot to add the files we changed to our index. Remember to save your file, then use git add (or if you're trying to push it in eclipse, then you need to right click on the file, then go to Team --> Add to Index) before you commit and push.

answered by (1 point)
+2

Sorry, had to down-vote your answer, since the "fast-forward" message is not an error, and it has nothing to do with revert ing things in git. (You might right that this situation could have resulted from forgetting to add/commit the changes locally... although in that case, I would expect a different error about refusing to pull because it might overwrite untracked changes in the working directory...)

...