git commit遇到with ‘#‘ will be ignored, and an empty message aborts the commit.或git log失败的原因及两种解决方案。

这篇具有很好参考价值的文章主要介绍了git commit遇到with ‘#‘ will be ignored, and an empty message aborts the commit.或git log失败的原因及两种解决方案。。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题原因

git add与commit操作已经搞完了,git log碰到下面的问题

fatal: your current branch 'master' does not have any commits yet

或者

git提交时,使用了git commit <文件名> 时弹出了以下窗口

git log 失败,笔记,git,vim,linux,github

 文段翻译过来的大意为:

请为本次修改键入commit命令的相关消息,以#开头的行被挡住注释(被忽略),一个空的消息(啥都不输入)将视为放弃本次commit提交。

解决方法:

1、改用 git commit -m “commit messge” 即可,"  "中的commit message可自行替换

如:

git commit -m "你好呀"

2、在vim插入模式下,在非#开头行处添加commit message ,然后使用 wq或者 wq!保存退出。

vim模式保存后显示提交成功:

git log 失败,笔记,git,vim,linux,github文章来源地址https://www.toymoban.com/news/detail-593944.html

到了这里,关于git commit遇到with ‘#‘ will be ignored, and an empty message aborts the commit.或git log失败的原因及两种解决方案。的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • git commit 规范不对导致报错subject may not be empty [subject-empty]type may not be empty [type-empty]

    git commit 规范不对导致报错subject may not be empty [subject-empty]type may not be empty [type-empty]

    使用commitlint之后报错 报错信息 找了很久原因,才发现TMD这里要有空格才能算正确的提交,emo 真是个奇葩的报错

    2024年02月12日
    浏览(12)
  • 解决Git 报错:fatal: destination path ‘xxx‘ already exists and is not an empty directory

    解决Git 报错:fatal: destination path ‘xxx‘ already exists and is not an empty directory

    拿到开发的Git地址,然后Git clone的时候,检测不出东西,只有一个.git目录,实际无东西。 可手动删除,或执行下面命令 然后再执行检出命令 熟悉 linux 命令都知道 rm -rf .git 命令会删除当前目录的 git 记录,如果没有把握的话,最好还是新建一个目录,比如xxx 目录,命令如下

    2024年02月05日
    浏览(13)
  • JAR will be empty - no content was marked for inclusion!

    JAR will be empty - no content was marked for inclusion!

            在对自建pom依赖组件打包时,出现JAR will be empty - no content was marked for inclusion!错误。        在pom中怎么加packaging标签内容为pom,标识只打包pom文件  完成

    2024年02月09日
    浏览(12)
  • Nacos Ignore the empty nacos configuration and get it based on dataId

    Nacos Ignore the empty nacos configuration and get it based on dataId

    1.配置错误  dataId问题 启动日志: 使用properties格式的文件: 使用yaml文件格式: 官方介绍: 在 Nacos Spring Cloud 中, dataId  的完整格式如下: prefix  默认为  spring.application.name  的值,也可以通过配置项  spring.cloud.nacos.config.prefix 来配置。 spring.profiles.active  即为当前环境对

    2024年02月08日
    浏览(7)
  • git fatal: ‘xxx‘ is not a commit and a branch ‘xxx‘ ‘ cannot be created from it

    当拉取一个git远程仓库分支时报错: 命令:git checkout -b 本地分支名 远程分支名 报错:fatal: \\\'origin/dev_v2.8.4_v10.74.1\\\' is not a commit and a branch \\\'dev_v2.8.4_v10.74.1\\\' cannot be created from it 远程新建的分支没有更新到本地。实际上,git仓库分为本地仓库和远程仓库,我们用 checkout 命令是从本

    2024年02月10日
    浏览(8)
  • 【Git报错】fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    【Git报错】fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    发现问题 远程已有分支,本地需要新建对应分支,于是执行命令: git checkout --track origin/XXX 时报错。 原因: 远程真的没有这个分支,所以失败 这个情况没什么好说的 远程有这个分支,但是本地认为远程没有这个分支 执行如下命令,查看本地缓存的所有远程分支,看看你要

    2024年02月16日
    浏览(13)
  • git拉取远程分支到本地报错fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    git拉取远程分支到本地报错fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    远程已有分支,本地需要新建对应分支,报下面错误 原因: 远程真的没有这个分支,所以失败 远程有这个分支,但是本地认为远程没有这个分支 执行 git branch -r 命令,查看本地缓存的所有远程分支 输出显示远程并没有要拉取的分支,但是实际上远程仓库是有该分支的,从

    2024年02月15日
    浏览(13)
  • 【YOLO问题记录】UserWarning: torch.meshgrid: in an upcoming release,it will be required to pass the......

    在pycharm上训练yolo数据集的时候,运行train.py报错: 解决方法: 找到pyrcharm所用的虚拟环境下的functional.py文件,根据报错的提示找到functional的504行 加上代码indexing = \\\'ij\\\' 虽然这 好像是torch包里的源码, 按道理说不应该改,但是确实问题解决了 参考文章:YOLO UserWarning: torch.m

    2024年02月05日
    浏览(10)
  • Git Commit Message规范

    Git Commit Message规范

    Git commit message规范是一种良好的实践,可以帮助开发团队更好地理解和维护代码库的历史记录。它可以提高代码质量、可读性和可维护性。下面是一种常见的Git commit message规范,通常被称为\\\"Conventional Commits\\\"规范: 每次提交,Commit message 都包括三个部分: Header , Body 和 Foot

    2024年04月14日
    浏览(10)
  • git 修改历史 commit message

    git 修改历史 commit message

    直接使用下面的命令,如果打开的是 vim 编辑器,先切换到英文输入法, 键入 i 开始编辑(编辑完后也记得转为英文输入法), 再键入 Esc 结束编辑并键入 :wq 保存退出即可。 步骤: 通过 rebase 变基实现 查看最近的3次提交: 当通过查看 log 定位出要修改的 commit 的位置后,就

    2024年04月25日
    浏览(10)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包