Linux learning record. 5.git & GitHub

Source: Internet
Author: User

Reference

Https://www.linuxidc.com/Linux/2016-11/136769.htm

Installation

Installing Git:apt-get Install Git

View current version: Git--version

Configure Git

$ git config--global user.name "Your name"
$ git config--global user.email "Your email Address"

View configuration information: Git config--list

Create a local repository

Git init [..]

Add file to Staging: Git add [...]

Git add-a added so there are files

Submit to Repository:git commit-m "comment"

View uncommitted files: Git status

Compare changes to uncommitted files: Git diff [...]

View Submit Log:git log [--pretty=oneline]

Version fallback: git reset--hard head^[~n]

Delete: RM [...] Need commit after

GitHub

Create SSH key:ssh-keygen-t rsa–c "[Email protected]"

Login to GitHub, add SSH key, save! Establish respository

Connect locally: Git remote add Origin https://github.com/RainbowMarquee/myvscodetest.git
Upload to GitHub, push to master branch: Git push-u Origin Master

Upload: Git push origin [branch name]

Dropdown: Git pull origin [branch name]

Long to Local: Git clone [link]

Branch

View branches: Git branch

Create a branch: Git branch name

Switch branches: git checkout name

Create + Switch branch: git checkout–b name

Merge a branch to the current branch: git merge name

Delete branch: git branch–d name

Linux learning record. 5.git & GitHub

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.