Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I forgot to pull the project code from remote repo. Now I have modified the code. I want to commit and push it to remote repo. 
But my friends have also modified the code in the same branch. Now how to handle this situation.
I have commited the code locally. I know there will be a merge conflict when I will push and pull.

What I have tried:

git add myfile
git commit -m "my_commit"
Posted
Updated 28-Jun-19 2:09am
Comments
[no name] 27-Jun-19 16:58pm    
Live and learn. Better document it for "next time".

1 solution

Quote:
I know there will be a merge conflict when I will push and pull.
Then resolve that conflict!

Because you didn't follow the correct procedure you just have to do the work manually instead.

1. Take a full backup of your code somewhere. Renaming the project might also be a good idea but shouldn't be necessary.

2. Pull the code from the remote repository

3. Compare each files against your backup copy and reapply your changes - there are several free tools available to do this e.g. Notepad++[^] or FC - How to Use FC (File Compare) from the Windows Command Prompt[^]

4. Do your unit testing etc then commit your changes

5. Discard your backup copy

6. Take heed of the advice from @salty06 in the comment and the posting guidelines for this forum.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900