git 命令总结

常用的git命令

git remote -v 查看git目录

git clone 克隆(默认master,注意切换分支)

 

git commit -m ‘备注’

git commit -a = git add  git commit

git push

 

git status 查看状态

git status -s 简易版

 

git mv file_name new_file_name    重命名

 

git log

git log - p -2 最近2次提交的详情

git log -U1 —word-diff

git log —stat 简要信息

git log —pretty=oneline(short,full,fuller)

git reflog  查看所有分支的所有操作记录

 

git diff 查看文件差异 为暂存

git diff —cached   查看文件差异     已暂存

 

git mv file_from file_to 文件改名

git log -p(显示内容差异) -2(最近2次) --stat(简略信息) 提交历史

git checkout --file 覆盖本地文件

git branch -a 查看分支

git checkout develop 切换分支   

git branch   查看分支

git branch name 创建分支

git checkout -b name  创建+切换分支

git branch -d name 删除分支

git merge origin/master   合并

 

合并失败

$:git merge --abort

$:git reset --merge

$:git pull

 

git pull 冲突解决

1.git stash 备份当前工作区,从最近一次提交总读取内容

git pull 

git stash pop 回复工作区

git stash list

 

2.放弃本地修改,直接覆盖

git reset —hard

git pull

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值