Basic usage of Git

Source: Internet
Author: User

has been developed with Gitextension, the advantage of graphical interface is easy to understand, now may I level is not enough, not able to tell him a lot of harm, as for now I started to abandon the graphical interface using git completely because now the company, now the work of the development of the warehouse with Git, So it's always a call. Use git command line chant.

The benefits of using GIT commands are still there. This practice is to think git command line way is really high-end, first look at the high-end, after all, remember a lot of commands, put a force. Ha ha. Secondly, with the command line basically do not travel card machine phenomenon, used gitextension know that software often card. Then I remember that the first time I pulled a git project, I had to use the command line. Use git extension to pull it down. The benefits of the command line are reflected. Most importantly, if you can get a good command of GIT commands, it's definitely faster than using a graphical interface.

After these days of groping, now summarize the basic commands learned:

    • Clone archives: git clone 【github上的那个https或者ssh地址】 ;
    • Add, new Add file to submit, first: git add --all ;
    • Submit the local archive, plus then: git commit -a if there are no newly added files, run the command directly;
    • View the status of the branch: git status , from here can be seen that the files are not submitted, which ask Price is newly added;
    • Submit the remote archive git push so that you can access GitHub from another computer to view the code you submitted on the other computer;
    • Pull substitution code: git pull ;
    • New branch: git branch 【分支名字】 ;
    • Switch branches: git checkout [分支名字] Note that the code must be submitted locally before switching;
    • To add a branch to the remote end: git remote add [远程服务器端名字,随便起一个名字][github上的那个https或者ssh地址] ;
    • Push a new branch onto GitHub: git push [远程服务器端名字][分支名字] ;
    • View recent action records: git log ;
    • -

Basic usage of Git

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: info-contact@alibabacloud.com 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.