Confusion in resolving merge conflicts

Confusion in resolving merge conflicts after using pull command for module 2. Do I have to accept the incoming changes or not? The incoming changes have new functions and accepting them would result in the loss of old ones.

retain all your previous work and accept all new changes

Mostly it will be accept both changes. Some will be accept new changes. Be careful and select your choice.

I accepted the incoming changes. Now how can i go to a previous commit. I used commit for local repo after solving merge conflict.

Should we need to accept incoming changes?

You need to keep both changes, since the old methods are used as well along with the new function stubs. You’ll need to manually combine them by removing the extra class declaration and main declarations.


I think that i made a mistake by accepting incoming and discarding current changes. But i am not sure

So what should i do now @shoryajain

Try resetting it to last committed stage for the previous module you completed and taking a fresh pull?

I am using a git reset hard. But it takes me to the commit after the merge conflict

I think git reset --hard with the commit id where you committed and pushed the code for last module should work here.

I am using git log to get the commit id but it shows current branch does not have any commits yet

How about a simple undo? That isn’t working after the commit when you resolved the conflicts?

Git reset hard does the same thing right? It takes me back to previous commit

I deleted the local repo and the pulled again. It worked. Thank god

How did you do that?

Went into workspace directory and used
rm -rf reponame
Then went to setup page of module 1 and cloned the repo

And then pulled the stubs for module 2

I only did the part till cloning of repo from module 1 setup as i already pushed changes for module 1.

And then i pulled the stubs for module 2

How to know the reponame

Your local repo directory. It looks like this

Okay thanks :slight_smile: