// 查看本地git情况
git status
// 初始化仓库
git init
// 创建本地分支
git checkout -b login
// 查看本地分支情况
git branch
// 切换本地主分支
git checkout master
// 提交代码到本地缓存区
git add .
// 提交代码到版本库
git commit -m "注释"
// 查看远程仓库地址
git remote -v
// 关联远程仓库
git remote add origin + 远程仓库地址
// 删除远程仓库
git remote rm origin (只是取消关联)
// 提交代码到远程仓库(提交到默认)
git push
// 提交到指定远程仓库
git push origin master
原文:https://www.cnblogs.com/liupu1995/p/14376555.html