相关疑难解决方法(0)

如何防止NUL字节出现在我的GIT存储库中并提交消息?

我有一个相对干净的安装Mac OS X Mavericks 10.9运行git版本1.8.5.1; 我的文件在已安装的SMB共享上,我无法再使用我的GIT存储库,因为NULL字节(\ 0)不断出现在我的所有版本控制文件中......甚至在动态生成的文件中也是如此通过GIT.

git commit -m "Test message"手工打字,给我:

error: a NULL byte in commit log message not allowed.
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)

如果我尝试git commit改为,则pico视图中显示的默认提交消息如下所示:

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch feature/centos_support
# Your branch is up-to-date with 'origin/feature/centos_support'.
#
# Changes to be committed:
#       modified:   README.md
# …
Run Code Online (Sandbox Code Playgroud)

git macos smb

8
推荐指数
1
解决办法
2224
查看次数

格式化来自shell的GitHub提交消息

我刚刚阅读了写好的提交消息并且非常喜欢它.问题是,我更喜欢命令行(plain ole' git).

  • 如何添加换行符和标签以提交消息,以便有一个"摘要行"和消息正文(可能包含几个段落)?
  • GitHub是否在提交消息中支持markdown?在阅读"Shiny new commit styles"后,这似乎不可能

markdown github

8
推荐指数
2
解决办法
9757
查看次数

有没有办法在执行git提交时使用我的.vimrc?

我已经让我的.vimrc以非常酷的方式满足了我的需求,而且我已经习惯了.这就是为什么当我的不同快捷方式和绑定不像git commit vim那样工作时,我总是感到困惑.

有没有办法使用我的普通vim配置?为什么这与普通的vim有所不同?这不使用我当地的vim编辑器吗?

根据这个问题,我已经将vim设置为标准编辑器.

谢谢!

更新

我使用的是Mac OS X Sierra.

:version在git vim里面返回正确的文件'$HOME/.vimrc'.

更新2

我其实是在使用Neovim.但我将VISUAL设置为'nvim',但它仍然不起作用.

git vim config neovim

6
推荐指数
1
解决办法
563
查看次数

恢复 Git 编辑器

我尝试更改 Git 的本机代码编辑器,但没有成功。现在,每当我尝试恢复提交时,都会收到以下错误:

hint: Waiting for your editor to close the file... notepad++.exe -wl1: notepad++.exe: command not found
error: There was a problem with the editor 'notepad++.exe -wl1'.
Please supply the message using either -m or -F option.
Run Code Online (Sandbox Code Playgroud)

我想知道如何重置或删除我所做的尝试修改。

git text-editor git-revert

6
推荐指数
1
解决办法
5126
查看次数

使用"git commit -a"命令时出现问题

我试图通过使用以下命令提交所有更改

git commit -a
Run Code Online (Sandbox Code Playgroud)

注意:我想提交没有任何"提交消息"

但是当我执行上面的命令时它会显示下面显示的屏幕,我不知道如何离开这个屏幕来完成我的提交.

在此输入图像描述

git repository git-commit git-commands

5
推荐指数
1
解决办法
377
查看次数

Git打开默认的git编辑器而不是VIM或任何其他编辑器(Git Rebase)

我最近安装了Vim.现在,当我以交互模式重新分支我的分支时,Git会自动打开Vim.

但是,我不想以交互模式打开Vim; 相反,我想打开默认的Git交互模式编辑器.如何设置Git使用的默认交互式编辑器?

git vim git-interactive-rebase

5
推荐指数
1
解决办法
6985
查看次数

Git 提交失败:“请使用 -m 或 -F 选项提供消息。”

当我键入 git commit 命令来提交文件时,我收到以下错误消息:

Microsoft Visual Studio:微软:找不到命令

错误:核心编辑器“Microsoft Visual Studio”存在问题。

请使用 -m 或 -F 选项提供消息。

git git-commit

5
推荐指数
1
解决办法
5519
查看次数

如何将git中的文本编辑器更改为Sublime-当前git commit命令正在记事本中打开

Despite similar questions that have been posted in the community, I have not seen this specific question addressed.

I am trying to change the default text editor used by git to Sublime. I am using a Windows machine and downloaded Sublime 3.

Initially, I was running the command git config --global core.editor "'C:\\Program Files\\Sublime Text 3\\sublime_text.exe' -n -w" in Git Bash, then when I ran a git commit it did not open an editor (it just used the Git Bash …

git text-editor sublimetext3

5
推荐指数
1
解决办法
944
查看次数

保存vimfiles的git commit error

我在nettuts easy git guide关注简单的git指南

我在我的~/目录中初始化了一个空的git实例,然后添加了我.vimrc和我的.vim/文件.

git add .vimrc
git add .vim
Run Code Online (Sandbox Code Playgroud)

但是,当我执行git commit命令时,我最终得到了似乎无关的错误消息.

sayth@linux-kt34:~> git commit
Error detected while processing /home/sayth/.vimrc:
line  203:
E319: Sorry, the command is not available in this version: py << EOF
line  204:
E492: Not an editor command: import os.path
line  205:
E492: Not an editor command: import sys
line  206:
E492: Not an editor command: import vim
line  207:
E15: Invalid expression: 'VIRTUAL_ENV' …
Run Code Online (Sandbox Code Playgroud)

git vim

4
推荐指数
1
解决办法
1037
查看次数

我不小心将 git 编辑器设置为 Atom,如何将其恢复为 Git Bash?

因此,我遇到了一个错误,内容是“请输入提交消息来解释为什么需要进行此合并,特别是如果它将更新的上游合并到主题分支中”,我在此线程中找到了解决方案。

然而答案之一说,你的文本编辑器是问题所在,所以将其更改为 Atom,并且在不知道如何在 Atom 中使用编辑器的情况下,我通过以下代码将 git 编辑器更改为 Atom:

git config --global core.editor "atom --wait"
Run Code Online (Sandbox Code Playgroud)

我正在使用 Git Bash,我想回到它作为我的核心编辑器,但我似乎找不到一种方法来做到这一点。

PS 我刚接触 Git 几天,所以请原谅我犯的任何基本错误。

windows git github git-bash atom-editor

4
推荐指数
1
解决办法
1114
查看次数