The preparatory work

If you have not installed the package, download it from the official website

Installation complete, start using.

1. Select Clone,, to clone the company’s or your own warehouse’s code. Corresponding operation code,

git clone xxxxxxxxxxxxxxxxxxxxxx.git
Copy the code

As shown in figure:

Click clone. Wait a few minutes. Depending on the size of the project, there may be a difference in the length of the clone.

General company code will have permission verification, here you can enter your account password with permission, click login

View-based operations such as checkout,commit,push, etc

Checkout checks out the branch

Pull the remote branch

For now, if dev is the project development branch, go to remote -orgin-dev, mail -> Check out to check out the remote branch to the local, so that your local has a remote branch mapping. Equivalent to the command line

git branch -d dev origin/dev 
Copy the code

Pull the remote dev, create the local dev and switch to the dev branch

Commit Commit operation

Let’s make any changes to the files (except the directories and files in.gitignore, which git ignores to track), and then go back to The soureTree and take a look at the view interface.

SoureTree can check the status of the file according to git status.

Git add file git commit -m “Remarks info” git commit suocreTree

Click Temporary Save all and enter the remark information. The remark information must be entered according to the specification, which plays a very important role in the investigation of S accident after team collaboration.

Click submit,

A successful submission will also prompt me that I have closed the window.

When this happens, you will see that there is an extra corner on the right side of the branch dev and on the pushed side. The number behind it indicates how many versions of your local branch are in advance. If there is a corner mark on it, indicate how many versions your local warehouse is behind.

Always pull the code before submitting it, so that you can sync up with the latest code of others, so that you can submit the code, and avoid a lot of problems.

Git fetch does not synchronize the remote code with the local code. The specific scenario depends on the individual.

Merge the merge

Keep your code up to date before merging; otherwise, unnecessary conflicts may occur

I want to merge master into dev

1, switch to dev, 2, right-click the master branch and merge the master into the current branch. Sure.

Wait for the merge result. If a red error is reported, check the fault and locate the fault. There is also a high probability of some code conflicts. Click working Copy – File Status to see if there is a file with a chart with an exclamation mark, work with the developer to resolve the conflict, and commit again to merge branches. Pull code will also encounter collision problems, the same way to resolve.