git 常用操作命令 唏嘘

1、项目clone 到本地(克隆指定分支)

git clone  <-b 分支名>  地址

2、git仓库添加新的分支,本地查看不到新分支

git fetch origin --prune

git remote update origin --prune

git remote update origin -p

3、查看本地代码状态

git status 

4、切换分支

git checkout -b 分支名

5、查看所有分支

git branch -a

6、已commit,但是需要撤回

git log 查看提交记录 找到需要回退的id

git reset --soft   commit_id

原文地址:https://www.cnblogs.com/wongzzh/p/15748370.html