Git 常用命令

Git 常用命令

# git init 创建仓库,初始化
# git add . 上传全部文件
# git status 查看状态
# git add filename  上传文件
# git log 查看远程仓库有几个版本
# git reflog 详细查看
# git reset --hard 版本号: 回滚
# git checkout 进入分支
# git branch 分支名: 创建分支
# git branch -d 分支名:删除分支
# git merge 合并分支名:合并分支
# git commit -m "第一次提交"  提交备注
# git remote add origin 在本地和远程仓库进行添加
# git push -u origin master 提交到master 分支
# git push -u origin master -f 强制提交
# git commit -m "第一次提交"  提交备注
# 提示dquote,表示语句未输入完,输入“回车即可
# git push -u origin master 提交到master 分支
# 提示错误,可继续提交强制提交
# git push -u origin master -f 强制提交

其他常用命令
https://www.cnblogs.com/jiangchunsheng/p/9206195.html

原文地址:https://www.cnblogs.com/zhangshan33/p/11136535.html