【问题标题】:git commit prints out message in a single linegit commit 在一行中打印出消息
【发布时间】:2021-11-23 08:11:42
【问题描述】:

我正在尝试使用 Git 提交文件。我正在使用记事本输入更改的提交消息,但是下面的行应该以多行打印(以 CRLF 结尾的行),它们被连接在一起。我检查了git config --global core.autocrlf,在配置文件中是真的。对正在发生的事情有任何想法吗?

# Please enter the commit message for your changes. 
# Lines starting with '#' will be ignored, and an empty message aborts the commit.
# On branch mo-dev 
# Changes to be committed: modified:  
# README.txt new file:   
# new_mo_file.txt

【问题讨论】:

  • 您在 Windows 上吗?我建议使用notepad++,它可以正确显示带有LF行结尾的文件
  • 我用的是Windows 7 64,怎么改?使用 Git 命令?我在安装过程中配置了 Git 客户端。
  • 使用记事本提交文件?可以上传视频吗?
  • 更改 git 用作文本编辑器的内容:theserverside.com/blog/…
  • core.autocrlf 适用于移入和移出提交的文件;它不适用于git commit 为运行提交消息编辑器而创建的临时文件。顺便说一句,对于这些文件依赖core.autocrlf 通常被认为是不明智的:改用.gitattributes 指令。无论如何,这与您的提交消息问题无关。

标签: git commit


【解决方案1】:

我会尝试使用不同的编辑器或像 gitk 这样的涂鸦 git 客户端。 https://git-scm.com/downloads/guis

也可以在命令行中直接添加您的提交消息: git commit -m "输入提交信息"

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
  • 我已经重新安装了 Git,它运行良好!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-30
  • 2014-02-28
  • 1970-01-01
  • 1970-01-01
  • 2021-05-15
相关资源
最近更新 更多