Ubuntu installs git and uses the GIT server provided by CSDN to manage project code

Source: Internet
Author: User
Tags git client

1. Install the GIT client

sudo apt-get install git

2. Setting up user names and messages

git config--global user.name "XXXX"

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

3. Initialize to an empty project that contains only empty readme.md files:

Touch readme.md

Git init

git add readme.md

Git commit-m "First commit"

git remote add origin [email protected]:sssss/feathersync.git

Git push-u Origin Master

4. The above will report no permissions, mainly without generating a public key

Ssh-keygen-c ' [email protected] '-t RSA

5. The public key is generated by default in the following directory

/home/zhigang/.ssh/id_rsa.pub

6. The contents of the public key file generated above are all pasted into the public key content of the CSDN Code project, and the name is arbitrarily set

7. First submission of all project documents

git Add.

Use git show to see some of the status of your project

Use git branch-a to see all of the branches

Use git branch-r to see the remote branch situation

Git commit-m "First commit all project files."

8. Push to the remote branch

Git push Origin Master:master

Git pull < remote host name > < remote branch name >:< local branch name >

origin specifies which remote you want to push to

If you omit the < remote branch name >,git you think you want to push to remote repository under the same name as local branch branch

So, you can write it in simple:

Git push Origin masteR


9. The previous update was rejected,

Git pull < remote host name > < remote branch name >:< local branch name >

Git pull Origin Master:master
To pull the master branch of the Orgin repository onto the local master branch, omit the < local branch name >

Can be simply written as:

Git pull Origin Master

Pull annotations may need to be provided during pull, and after pull is successful, you can use the following command to submit the

Git push Origin masteR







Ubuntu installs git and uses the GIT server provided by CSDN to manage project code

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.