Basic use of Sourcetree (including ssh specific configuration), nanny-level tutorial

 SourceTree is a free Git and Hg client management tool under Windows and Mac OS X , as well as a Mn version control system tool. Operations such as create, clone, commit, push, pull, and merge are supported. It is extremely friendly for novices who are not familiar with git, this article will introduce the basic use of sourcetree.

download sourcetree

Sourcetree | Free Git GUI for Mac and Windows

Register, log in to your account, and install.

new warehouse

Enter your local project, click Create

 

 After success, there will be this in the project

Staging project:

 

submit project

 

At this point, we have completed the local operation, but if we want to push the project to the remote warehouse, we must associate the remote warehouse, as follows, there will be an exclamation mark if there is no association with the remote warehouse:

 

There are two ways to associate remote warehouses, one is http protocol association, which needs to close the SSL layer protocol. I am afraid that I will not be able to change the network configuration of the computer after this comparison, so I did not do it (many people on the Internet are It didn’t work out, so they adopted the method of cloning the remote warehouse first, and then pushing the local warehouse up). The other is to configure the ssh public key and use ssh association.

Use git bash to configure an ssh key globally, and then copy it to the code hosting platform to configure the ssh public key. I won’t go into details on how to do it here. There are many tutorials on Baidu on the Internet. The following is a screenshot of the configuration:

In the local system disk:

 I have configured two keys before, choose a file name ending in .pub and configure it in sourcetree, open the tool, options:

 In general, the ssh key and id_rsa.pub file are imported. If the sourcetree cannot find this file for the first time, you can directly write the value of the key in first, and the same is true.

 

 

Create a new warehouse on the code hosting platform (here takes github as an example):

 

 

 

The warehouse is created, copy the ssh address:

Associate the remote warehouse on the local warehouse:

 

 

Add remote repository:

 

Fill in the remote name and url here (your remote warehouse address) 

 

 

 After linking:

Click Push to push the contents of the local warehouse to the remote warehouse:

 

 

Refresh the remote warehouse to see the things in our local warehouse

 

The basic operations of other clones are also very simple. You can think about it yourself. This article is only the most basic operation of sourcetree. Later, we will talk about more advanced operations such as branching. Welcome to pay attention~~ 

Guess you like

Origin blog.csdn.net/weixin_61719769/article/details/129844002