Cygwin 和 TortoiseGit

发布于 2024-09-25 18:16:15 字数 250 浏览 4 评论 0 原文

我最近在全新安装的 Windows XP 上安装了 Cygwin、Git 二进制文件和 TortoiseGit 的副本。我似乎能够通过 TortoiseGit 执行大多数 Git 操作,例如查看日志等,但是当我通过 TortoiseGit 提交时,我收到此消息...

错误:无法创建临时 sha1 文件名:没有这样的文件或目录

我可以通过命令行提交 - 我只是似乎无法通过 gui 界面提交!

I have recently installed Cygwin along with the Git binaries and a copy of TortoiseGit on a fresh Windows XP install. I seem to be able to do most Git operations through TortoiseGit such as viewing the logs etc, but when I come to commit via TortoiseGit I get this message...

error: unable to create temporary sha1
filename : No such file or directory

I am able to commit via the command line - I just dont seem able to commit through the gui interface!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

瑾兮 2024-10-02 18:16:16

这是已知问题,但现已标记为已修复。有关背景信息,请参阅https://tortoisegit.org/issue/56,它是重复的https://tortoisegit.org/issue/609

This was known known issue, but its marked as fixed now. For background see https://tortoisegit.org/issue/56 and it's duplicate https://tortoisegit.org/issue/609.

辞慾 2024-10-02 18:16:16

我尝试了这些解决方案,但它们对我不起作用。所做的工作是将 cygwin 目录中所有与 GIT 相关的可执行文件移动到不在我的路径中的子文件夹中,然后我从 http://git-scm.com/,将已安装的 GIT 可执行文件的位置添加到我的路径中,杀死了 Windows 资源管理器和 Windows 资源管理器的所有实例。 bash windows,启动了 Windows 资源管理器的新实例,然后,我能够通过 TortoiseGit 提交。目前(2014 年 3 月 4 日)GIT 的 cygwin 版本为 1.7.9,而最新版本来自 http://git- scm.com/ 是 1.9.0。这似乎有所作为。

I tried those solutions, but they didn't work for me. What did work was to move all GIT related executables in the cygwin directory into a sub folder not in my path, then I installed the latest version of GIT from http://git-scm.com/, added the location of that installed GIT executable to my path, killed all instances of Windows Explorer & bash windows, launched a new instance of Windows Explorer, and then, I was able to commit via TortoiseGit. Currently (March 4, 2014) the cygwin version of GIT is 1.7.9, whereas the latest version from http://git-scm.com/ is 1.9.0. That seems to make a difference.

古镇旧梦 2024-10-02 18:16:16

“无法创建临时 sha1 文件名”问题已通过以下方式解决:

https://stackoverflow.com/a/685422/431606< /a>

我只是在我的存储库中运行 git repack(从命令行),TortoiseGit 立即能够提交。

(我仍然无法通过 TortoiseGit,因为我收到错误消息“致命:远程端意外挂起”,如 https://tortoisegit.org/issue/56

The "unable to create temporary sha1 filename" issue was solved for me by:

https://stackoverflow.com/a/685422/431606

I simply ran git repack (from the command line) in my repository, and TortoiseGit was immediately able to commit.

(I still can't push through TortoiseGit, as I get the error message "fatal: The remote end hung up unexpectedly" as described in https://tortoisegit.org/issue/56)

淡紫姑娘! 2024-10-02 18:16:16

您是否尝试过重新启动机器。我曾经在安装 Tortoise 时遇到过一些麻烦,但这解决了问题。

Have you tried to reboot your machine. I had some trouble with a Tortoise installation once, but that solved the problem.

尛丟丟 2024-10-02 18:16:15

TortoiseGit 针对 Windows 版 Git 进行了优化。

但是,从 TortoiseGit 1.8.13.0 开始,Cygwin git 也可以与 TortoiseGit 一起使用。

您必须在 TortoiseGit 设置上进行如下配置: 打开 TortoiseGit 设置对话框并打开常规页面。

1) 选择 [CYGWIN-INSTALL-PATH]\bin-folder 作为 git.exe 文件夹。

2)在Windows中配置HOME环境变量,使Cygwin
和 TortoiseGit 使用相同的主目录和全局目录
git 配置。此处使用普通的 Windows 表示法(例如,
“C:\用户\用户名”)。默认情况下,TortoiseGit 使用 Windows 主目录
目录通常位于 c:\Users 下,Cygwin 使用它的
自己的主目录位于
[CYGWIN-安装路径]\home。

3)配置AutoCrLf,这是TortoiseGit和Cygwin Git所必需的
有不同的默认值。 Cygwin Git 中的默认值为 true。

4) 进入 TortoiseGit 的“Advanced Settings”部分并进行设置
CygwinHack 设置为 true 以激活 cygwin 解决方法。

5) 重新启动。

基于 https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings .html

TortoiseGit is optimized for Git for Windows.

However, starting with TortoiseGit 1.8.13.0 Cygwin git can also be used with TortoiseGit.

You have to configure it as follows on TortoiseGit settings: Open TortoiseGit settings dialog and open the General page.

1) Select the [CYGWIN-INSTALL-PATH]\bin-folder as git.exe folder.

2) Configure the HOME environment variable in Windows, so that Cygwin
and TortoiseGit are using the same home directory and global
git-config. Use the normal Windows notation here (e.g.,
"C:\Users\USERNAME"). By default, TortoiseGit uses the Windows home
directory which is normally located under c:\Users and Cygwin uses its
own home directories which are located under
[CYGWIN-INSTALL-PATH]\home.

3) Configure AutoCrLf, this is necessary as TortoiseGit and Cygwin Git
have different defaults. The default in Cygwin Git is true.

4) Go to TortoiseGit the section called “Advanced Settings” and set
CygwinHack to true in order to activate cygwin workarounds.

5) Reboot.

Based on https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html

最笨的告白 2024-10-02 18:16:15

我遇到了同样的问题(决定使用 cygwin 下安装的 git,而不是 msysgit 中的 git)。同样的事情:我能够从命令行提交,我还能够在 Tortoise 中看到修改指示器和查看日志,但我无法通过 GUI 提交。

我所要做的就是调整我的项目和 git 可执行文件的组设置。从项目根目录上方的一级,我运行了以下命令:

chgrp -R None my_project/

然后我执行了以下操作:

cd /bin
chgrp None git.exe

这将 git 可执行文件的组从 (root) 更改为 None

请注意,您可能不想使用 None 组。查看 /etc/passwd 并查看以您的用户名开头的行的第四个字段(字段以冒号分隔,第一个字段是您的用户名)——第四个字段是您的主要组 ID。然后查看 /etc/group 并找到与 third 字段具有相同组 ID 的行。这是您要在上述命令中使用的组名称(代替 None)。

让我知道这是否适合您。

I had the same problem (decided to use git installed under cygwin instead of the one from msysgit). Same thing: I was able to commit from the command line, and I was also able to see modification indicators and view logs in Tortoise, but I could not commit through the GUI.

What I had to do was to adjust the group settings of my project and the git executable. From one level above my project root, I ran the following command:

chgrp -R None my_project/

Then I did the following:

cd /bin
chgrp None git.exe

This changed the group of the git executable from what it was (root) to None.

Note that you may not want to use the None group. Look at /etc/passwd and look at the fourth field of the line that starts with your user name (fields are colon-delimited and the first field is your user name)--that fourth field is your primary group ID. Then look at /etc/group and find the line that has the same group ID as the third field. That's the group name you want to use (in place of None) in the commands above.

Let me know if that works for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文