Git命令:撤销本地commit,解决remote: error: hook declined to update;解决Error: ENOSPC: no space left on device

Git命令:撤销本地commit

一、方式1

1、使用git log查询提交记录

2、使用git reset commitId回退到你想要的版本

ps:commitId就是git log里面显示的一长串字符,每次提交记录都有,你想要回退到哪个提交节点,就使用哪个commitId

二、方式2

其中两种方式不清除本地提交和清除本地提交的方法

1、回退到上次提交并清除本地提交的代码

git reset --hard HEAD^

2、回退到上次提交不清除本地提交的代码

git reset --soft HEAD~1

三、方式3(推荐)

问题:在mster分支写了半天,然后git commit 提交了 ,才发现 在masrter分支开发的。

解决:git reset HEAD~

git reset HEAD~

HEAD 代表:上一次提交

这样 刚刚提交的就又回到本地的local changes 列表中。nice
继续 切换分支,重新提交。

可以从vscode看到
在这里插入图片描述

git push 报错 remote: error: hook declined to update

push失败,提示remote: error: hook declined to update

我碰上这个错误的原因是, commitcomment的格式不对,git服务器上对这个项目的comment格式有限制,改comment的格式就好了。

如果大家碰上这个问题,可以问下项目负责人,是否对提交的注释格式有要求。

enospc android,【解决】Error: ENOSPC: no space left on device, watch

启动 node 项目时候出现报错Error: ENOSPC: no space left on device, watch

ENOSPC的含义是 Error No more hard-disk space available(没有更多的磁盘空间可以使用)

解决办法:把项目放在有足够的磁盘上进行运行。

猜你喜欢

转载自blog.csdn.net/qq_44732146/article/details/131185038