The first GitHub experience

Source: Internet
Author: User

Install GitHub (Windows mirroring)

$ git config--global user.name "username"

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

Create a repository (for git managed files)

$ mkdir learngit Create (folder) directory

$ cd Learngit Move to Directory

$ pwd Show current directory

Initialize the git repository ( by git init command to turn this directory into Git warehouses that can be managed: )

$ git init

add files to the git two section ( commit you can submit many files at once, so you can add different Files )

$ git add <file> Add File

$ git commit–m "caption" submit the action and bring the instructions

Modify the file (update the contents of the file, add and submit again)

$ git status View the current file status of the warehouse (whether modified)

$ git diff <file> have a good tell me, modify the content (you can use the Git status repeatedly to view the file status)

Update with Add file to git two section

Version fallback (view git log, I do not go back to action, log only operation)

$ git log (--pretty=oneline//Show only commit (version number) and action, and display on one line

Commit 46d1db4f3dc8ee7b1905a465071438d0e963cb1d

Author:feng-codeking <[email protected]>//user

Date:sat June 25 08:31:54 2016 +0800//Date

Add distributed//file operation

File deletion

$ RM <file>

Remote Warehouse

Create ssh

$ ssh-keygen–t rsa–c "[email protected]" (Get .ssh Directory, with id_rsa and id_rsa.pub two files, these two are SSH key key pair )

Login to GitHub, open "Account Settings", "SSH Keys" page, fill in any title, paste the contents of the Id_rsa.pub file in the key text box

associating remote libraries

$ git Remote add origin [email protected]:<username>/learngit.git

Push all the contents of the local library to the remote library

$ Git push–u Origin master ( first push plus –u parameter, then push $ git push origin master)

Cloning Remote Libraries

$ git clone [email protected]:<userrname>/<git Library name >.git

The first GitHub experience

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.