The previous days in the internship unit back-end project committed two dozen wrong, resulting in two laps, so, it is necessary to think about possible situations, and to do a good deal of measures;
Now the biggest problem is circular, so focus on this problem to solve:
Circle, the reason is the same branch because of the different project personnel to work together or a single project personnel working error caused by the unified branch appeared two lines, so will circle, so, the crux of the problem lies in the settlement of the base.
First, download the project;
Before making changes to the project, pull on the unchanged project to prevent further problems:
As a novice, it is best to build a branch of your own, but this branch is not committed, just for development, then, switch to the branch
Then develop on your new branch and commit
The development work is done, the following is the push problem
First, switch to the main branch, then pull
Here are two scenarios:
In simple cases, the other members did not modify the project during their own modification of the project, which is relatively simple, simply by merging their new branches into the main branch, or by reset the main branch to the new branch from the post commit.
Click OK to add the modified content to the main branch;
Or can be in the main branch, through the merge also line;
The development of other project personnel during their own development,
In this case, you can do this by rebase the new branch
The above picture is the result of Rebase, the new branch base is the newest remote branch, this is the first case, through the merge or reset can be
Is the result of the merge and then the push can be
In fact, a lot of things, so find a project to practice, to carry out some tests, you can learn a lot of things
git + tortoise Use