Version Control - 1. Common Git Operations

Introduction to git:
the best distributed version control system in the world

Git configuration

Win platform: You can download and install it
on the Git official website , or you can directly use some Terminals, such as Cmder, etc., to download and install its Full Version, which comes with Git For Windows.

The first thing to do after installing Git is to set up your username and e-mail address. This is very important because every Git commit will use this information. It is permanently embedded in your commit:

git config --global user.name "examplename"

git config --global user.email "[email protected]"
#查看现在的git环境详细配置
git config -l 

#查看系统配置
git config --system --list
  
#查看当前用户配置
git config --global  --list
 
#查看当前仓库配置信息
git config --local  --list

Initialize the local repository

vim README.md

git init

git add README.md

git commit -m "init the Project"

Associate a remote repository

When using Github, Gitlab, bitbucket, Alibaba Cloud code, etc. to maintain projects, there are generally two authentication methods. One is to create a local secret key and add it to the website by means of ssh private key; the other is to use https account. name and password.

ssh private key authentication method

https account password authentication

create branch

REF

http://www.cnblogs.com/best/p/7474442.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325369356&siteId=291194637