This is a note about how to merge the diverged changes from an upstream branch(such as “master”) to your working branch(such as “f1”).
Switch to the “master” branch and “git pull” to update to latest;
Switch to the “f1” branch and “git pull” to update to latest;
On the “f1” branch, run “git rebase master”;
If there are conficts:
“git status” to get the conflict file names list;
Open each confilct file and fix the conflicts;
Use “git add FILE” to mark each conflict file as resolved;
Now run “git rebase –continue” to continue the “rebase” process;
If conflicts happen, go back to step 1, until everything is merged;
Now git tells you the following information, you need to run git pull again, and merge again:
1 | On branch f1 |
Run “git pull”, if you get conflicts:
“git status” to get the conflict file names list;
Open each confilct file and fix the conflicts;
Run “git add FILES” and “git commit -m ‘comments’” to mark the conflict files as resolved;
Run “git pull” to continue the pulling process;
If conflicts happen, go back to step 1, until everything is merged;
Run “git push origin f1” to push your merged/updated code from local to remote;
Done.