git经常使用的命令

工具这些东西,必须非常的熟悉,要不遇到情况的时候,完全不知道怎么去解决。

##### git log

##### git log -p [-2]

##### git log --pretty=oneline 

最近提交的记录

##### git log --stat

扫描二维码关注公众号,回复: 6559274 查看本文章

##### git log -U1 --word-diff查看最近详细的提交的增删改查

### git log 

https://www.cnblogs.com/bellkosmos/p/5923439.html

#### 如何修改已经commit代码的备注

git commit –amend

里边有个小坑需要在git中配置vim编辑器。 https://www.jianshu.com/p/25cb74b08e5a

#### 如何修改已经push的代码的备注

git commit --amend 

进入修改页面修改注释信息,修改后:wq保存退出

git push --force-with-lease origin master

如果其他人已经下载或改动:
git fetch origin
git reset --hard origin/master

 如果想修改前两次的提交记录的commit请看这里  https://www.jianshu.com/p/0f1fbd50b4be

#### 如何回滚某一个文件,而不是所有的文件

#### 如何合并commit

#### 如何加入缓存

 git stash  https://www.cnblogs.com/zndxall/archive/2018/09/04/9586088.html

猜你喜欢

转载自www.cnblogs.com/coding4/p/11060934.html