Scenario:
(Assuming that the latest branch at the beginning is master)
a modified the branch and made a local commit,
b modified the branch and submitted it remotely.
At this time, the latest branch of the warehouse is b-master submitted by b,
but a has not updated the project, so The latest branch read by a is still master, and
there are two options for committing a
1. Merge (clear timeline)
Find the common ancestor of a and b
Combine a-master and b-master into a new node, new-master
2. Rebase (concise)
In accordance with the modified time sequence, connect in series
Suggest:
-
Update before encoding
-
Update before submitting
-
Check for compilation errors before submitting
-
The submission granularity is as small as possible, and the description is as accurate as possible
-
Modified public documents and notify other members to update as soon as possible
-
Most importantly, the team's division of labor must be clear
Reference link:
The difference between git merge and git rebase
Do you really understand git rebase?
Git code anti-lost guide (ideal git use)