Getting started with GitHub and sourcetree

Source: Internet
Author: User
Tags sourcetree

--> Register an account on GitHub and log in.

--> On GitHub, click Create new, new repository and enter a project name. Select init this repository with README, as shown in.

--> To delete a newly created Project, click setting in the lower right corner, as shown in.

--> Pull the page to the bottom, click Delete this repository, enter the project name in the pop-up layer, and click Delete, as shown in.

--> To clone a remote project locally, click the project you just created on GitHub to view the project details. There is a piece of information in the lower right corner to copy the HTTPS connection, as shown in figure

--> In a local directory, enter the following command, git clone, (here I used an open source project as an example ),

--> We can see that the newly created Project has nothing but a ReadMe file. You can copy the content of a Maven project to this directory. After compilation is correct, the following uses sourcetree as an example to describe how to submit changes using Visual GUI tools.

-- Download and install sourcetree. Take the Windows version as an example. After the installation is complete, open sourcetree, as shown in figure

--> Click File-open, select the root directory of the project we just cloned, and open it. As shown in, branches has only one master, and click uncommited changes on the right, all the files you have modified but not submitted are displayed.

--> To view the unstaged files, hold down shift, select all the files you want to submit, right click, and select Add (that is, add to the local index database ), after the operation is complete, the content of staged files will show all the files we just selected, as shown in

--> Before submitting a local Repo, set a GitHub account in sourcetree, click tool-> options, and enter your GitHub account information in full name and email address, for example

--> Return to our previous point. After selecting the file to be submitted to the local repository in staged files, click commit in the upper-left corner of sourcetree. We will enter comments about this commit, after entering the information, click Submit. You may be prompted to enter the GitHub user name and password, as shown in figure

--> At this point, we just submitted the data to the local repository. The last step is to submit the data to the remote repository. Click the push button on the toolbar to submit the data to the remote repository. Click pull to download the latest modifications submitted by others from the remote repository, as shown in figure

--> After you click "push", you will be asked to select the branch to be submitted to the remote warehouse. After you submit the branch to the remote warehouse, you can see the content you submitted on GitHub, as shown in figure

--> You can use cherry pick to directly commit the modified Code on branch 1 to branch 2. You can also go to the merge operation on Branch 2 to obtain the commit of other branches.

--> Branches in the Left bar of sourcetree can be deleted at will, and then select the branch you want to check out from remotes and clone it to the local repository.

--> So far, the use of githut and sourcetree has ended. The tool is just convenient and popular, and it is not excluded that only command line operations are used. Let's play with it...

Getting started with GitHub and sourcetree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.