Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

This may surprise you, but it took me over an hour to find out that it wasn’t a problem at all…

One, encounter problems

Use Source Tree to find the local branch is not displayed as shown below:


Second, process description

Problem generation process:

2.1 Creating a Warehouse

Create a new remote repository FenZhi, then clone to local repository FenZhi, create a branch CZY, and commit several times;

New branch process:

2.2 Clone Warehouse

Clone remote FenZhi, go to local fenzhi1, you can see local branch, but FenZhi can only see remote warehouse, you can’t see local warehouse:


Three, try to solve

As you can see from the picture above, I tried several times, but it didn’t solve my problem.

3.1 Search Questions

You must go to CSDN if you have a problem, so I found the following article:

I saw students who had the same problem; > If you want to display a branch in the source tree, you must commit it once with git client commint.

3.2 Git commint commit

Do you know how to use Git commint to submit

Here are some descriptions:

  1. Make changes or create a new file in your repository in preparation for submission. Here I create a new git.cs script as shown below:

  1. Open Source Tree repository, click terminal, the window will pop up as follows:

  1. Type the commandgit statusI can see that there is a git.cs file waiting to be added

  1. Type the commandgit add+ file name, file to buffer (temporary in SourceTree) :

  1. Type the commandgit pullPull remote repository, (corresponding to pull in SourceTree) :

  1. After the pull is successful, run the following command:Git commit -m "Commit remarksCommit to local repository (corresponding to commit in SourceTree) :

  1. Enter the command at lastgit push origin masterPush to remote repository, (corresponding to push in SourceTree) :

Git commint is now ready to commit. Restart the Source Tree to see if your branch is displayed.


Fourth, solve problems

After a meal, I found that I had encountered none of the above problems.

Accidentally mouse over the branch, saw the following cut head…

Solve the problem: then I clicked “>” to cut the head and the branch appeared.

What a joke… I saw that “branch” was gray and thought it could not be clicked. I also tried to open it by double-clicking, but it did not work, so I had the above trial process.


Those of you who see this, have you solved your problem? If you have any other questions or problems, feel free to comment and share