0.Setup and Config
config(配置)
查看当前git配置
git config --global --list
设置用户名和邮箱
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
1. Branching and Merging(分享与合并)
checkout
在某分支的基础上创建新分支,并切换到新分支
git checkout [某分支名]
git checkout -b [新分支名]
2. Sharing and Updating(分享与更新)
remote
1. 查看远程仓库信息
git remote -v
2. 关联远程仓库
git remote add origin [远程仓库地址]
3. 取消/断开与远程仓库的连接
git remote remove origin
git remote rm origin // 简写一点
4. 重新设置与远程仓库的连接
git remote set-url origin [远程仓库地址]