1 Initialize the repository and modify the vscode configuration

Enable the Git plug-in to display all sub-repositories. By default, only 10 sub-repositories are detected. If there are many sub-repositories, one point is required

2 Operate all sub-warehouses

2.1 Cut branches together

git submodule foreach git checkout -B origin/sit sit 
Copy the code

This is a force-cut branch, applicable to local branches that do not yet exist

git submodule foreach git checkout -b sit
Copy the code

This is the local branch, relative to the local branch that already has a branch

2.2 All Updates

git submodule foreach git pull

3 Operate the sub-warehouse independently

3.1 pull code

Pull in English

3.2 Stage, Commit, push

3.2.1 Click the + sign in the change to create stage, which corresponds to the command line git add

3.2.2 After entering the temporary storage area, enter “message” in the input box and click “commit”

After the commit succeeds, the number of entries to be pushed appears in the lower left corner

3.2.3 Click push to remote warehouse. This completes the complete code submission process

3.3 Merging Branches

Dev -> st = dev -> st = dev -> st

Pull code refer to 3.1

To start the merge, switch the local area to the ST branch and then perform the merge

Will let you pick the branch, so let’s pick the dev branch. Here you just merge your local repository and then perform a push (3.2.3) to the remote repository

3.4 Roll back the code

Git Reset and Git Revert are very useful for git rollback. For example, git Revert is recommended

4 Use gitLens plug-in

4.1 Viewing Warehouse Information

4.2 View the last modification and file history of each line of code

4.3 Rollback code, see 3.4