Git uses basic methods (get branch from remote server, commit changes)

Source: Internet
Author: User

Do project for the first time to use Git, not used before, completely did not understand, pondering the long to make almost, hereby share, you can go a little detour.

This time, the operating system is mint.

1. First you need to install Git

sudo apt-get install git

2. Create a new Git repository locally

Create a repository by creating a new folder and then opening the terminal in the folder and entering the command git init


3. Connect to a GIT server

The server we used this time is http://git.oschina.net.

Enter the command git remote add Origin <server>, replace <server> with the project address on Git.oschina.net

Git.oschina.net provides two kinds of connection methods, HTTPS connection and SSH connection, this time first introduced the HTTPS connection method, that is, the use of the address such as Https://git.oschina.net/xxxxx


4. Get the project branch

Use the command Git pull Origin master to get the project on the remote server (a bit different from clone)

You need to enter the user (mailbox) and password registered on git.oschina.net.


5. Modify the Content


6. Declaring the user (seemingly only entered at the first time, not later)

Use the command git config--global user.email "[Email protected]"


7. Submit Changes

Use the command git add * to commit all changes to the cache (local), waiting to be sent

Use the command git commit-m "Modify information" to submit the changes to head (local) and describe what modifications were made



8. Commit changes to the remote server

Use the command git to push Origin master, and then enter the user name and password (provided the project owner allows the submission)


You will then be able to see your submission on the server. Beginner's experience, if there is a mistake, also hope to enlighten



Git uses basic methods (get branch from remote server, commit changes)

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.