版本控制——1.Git常用操作

git简介:
目前世界上最好用的分布式版本控制系统

Git配置

Win平台:
Git官网下载安装即可,也可以直接使用一些Terminal,例如Cmder等,下载安装其Full Version,自带Git For Windows。

安装Git后首先要做的事情是设置你的用户名称和e-mail地址。这是非常重要的,因为每次Git提交都会使用该信息。它被永远的嵌入到了你的提交中:

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

初始化本地仓库

vim README.md

git init

git add README.md

git commit -m "init the Project"

关联远程仓库

使用Github、Gitlab、bitbucket、阿里云code等维护项目时,一般有两种认证方式,一种是通过 ssh 私钥的方式,创建本机秘钥并且添加到网站上;另一种通过 https 的账号名和密码。

ssh私钥认证方式

https 账号密码认证

创建分支

REF

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

猜你喜欢

转载自www.cnblogs.com/sylvan/p/8999465.html
今日推荐