常用命令,简要操作
配置账户
git config --global user.name "your name"
git config --global user.email "your email"
克隆
git clone URL
查看远程分支
git remote -v
查看分支
git branch
创建分支
git branch name
切换分支
git checkout name
更新
git pull
提交
git commit -m "log" files
查看log
git log -1 (file) 查看最近一次(文件)提交记录
推送
git push 将本地提交推送到远程服务分支
合并
git merge b 将b分支合并到当前分支
撤销
git revert HEAD 撤销前一次提交
git revert commitid 撤销此次提交
还原
git reset --hard 还原更改
git reset commitid 彻底回退此id版本