Pycharm对Git感到奇怪(树条目中的文件名包含反斜杠) [英] Pycharm behaving strange with Git (Filename in tree entry contains backslash)
问题描述
我刚买了一台新笔记本电脑,想用pycharm
克隆我的大学git存储库.
I just got a new laptop and wanted to clone my universities git repository with pycharm
.
每当我尝试使用Git bash/GUI或Pycharm克隆存储库时,都会失败并显示错误消息,
Whenever I try to clone the repository, using either Git bash/GUI or Pycharm, it fails with the error,
树条目中的文件名包含反斜杠:'Aufgabe4a.py#coding = utf-8 ...
Filename in tree entry contains backslash: 'Aufgabe4a.py# coding=utf-8 ...
错误是所提到文件的完整内容.
因为这是我大学的仓库,所以我不能只是去重命名不是我的文件. 奇怪的是,这在我的桌面上不会发生.我可以在那里克隆仓库.
As this is the repo of my university, I can't just go and rename files that are not mine. The weird thing is, this doesn't happen on my desktop. I can clone the repo just fine on there.
- 两台机器都运行Windows 10和最新版本的Git/Pycharm.
- SSH配置正确,我也无法使用HTTPS进行克隆.
我很期待您的建议,因为我需要此仓库来进行练习,但并不总是可以访问我的桌面.
I look forward to your suggestions, as I need this repo to hand in my exercises and don't always have access to my desktop.
存储库中没有单个文件的名称中包含反斜杠.我浏览了网站和工作副本",这是一个iOS应用程序,用于预览Git存储库.
There is not a single file in the repository containing a backslash in its name. I checked through the website and "working copy", an iOS app to preview Git repos.
这些是在笔记本电脑上使用Git调试时的结果:
These are the results when debugging with Git on the laptop:
18:28:45.034704 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
18:28:45.036676 git.c:439 trace: built-in: git clone git@*removed*.git
Cloning into 'uebungen'...
18:28:45.093121 run-command.c:663 trace: run_command: unset GIT_DIR; ssh git@*university URL* 'git-upload-pack '\''*university repo*'\'''
18:28:48.140893 run-command.c:663 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 8492 on DESKTOP-QNIF5QA' --check-self-contained-and-connected
18:28:48.155482 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
18:28:48.157663 trace.c:375 setup: git_dir: C:/Users/*removed*/uebungen/.git
18:28:48.157663 trace.c:376 setup: git_common_dir: C:/Users/*removed*/uebungen/.git
18:28:48.157663 trace.c:377 setup: worktree: C:/Users/*removed*
18:28:48.157663 trace.c:378 setup: cwd: C:/Users/*removed*
18:28:48.157663 trace.c:379 setup: prefix: (null)
18:28:48.158012 git.c:439 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 8492 on DESKTOP-QNIF5QA' --check-self-contained-and-connected
remote:
remote: Enumerating objects: 828, done.
remote:
(...)
remote: Counting objects: 100% (828/828), done.
remote:
(...)
remote:
remote: Compressing objects: 100% (380/380), done.
remote: Total 1184 (delta 490), reused 725 (delta 430)
error: filename in tree entry contains backslash: 'Aufgabe4a.py# coding=utf-8
import random #Liste für die Auswahlmöglichkeiten für den Rechner list = ["Schere", "Stein", "Papier"] #Eingabemöglichkeit für den Benutzer print("Versuchen Sie ihr Glück in Schere, Stein, Papier!") w = (raw_input("Bitte wählen sie Schere, Stein, oder Papier:")) # if w == "Schere": print("Sie haben Schere gewaehlt!\n") else: if w == "Stein": print("Sie haben Stein gewaehlt!\n") else: if w == "Papier": print("Sie haben Papier geweahlt!\n") else: print("Sie haben keine zugelassene Eingabe getaetigt!") exit() #Wahl des Rechners wird, sowie der Ausgang des Spiels entschieden x = list[random.randint(0, 2)] print("Ihr Gegner hat " + x + " gewaehlt!\n") if w == "Schere": if x == "Schere": print("Sie haben unentschieden gespielt!") else: if x == "Stein": print("Stein schleift Schere, Sie haben verloren!") else: if x == "Papier": print("Schere schneidet Papier, Sie haben gewonnen!") elif w == "Stein": if x == "Schere": print("Stein schleift Schere, Sie haben geweonnen!") elif x == "Stein": print("Sie haben unentschieden gespielt!") elif x == "Papier": print("Papier umfaltet Stein, Sie haben verloren!") elif w == "Papier": if x == "Schere": print("Schere schneidet Papier, Sie haben verloren!") elif x == "Papier": print("Sie haben unentschieden gespielt!") elif x == "Stein": print("Papier umfaltet Stein, Sie haben gewonnen!")'
fatal: Not all child objects of 9(...)c are reachable
fatal: index-pack failed
这是台式机上的调试输出:
This is the debugging output on the desktop machine:
21:38:07.768170 exec-cmd.c:237 trace: resolved executable dir:C:/Program Files/Git/mingw64/bin
21:38:07.769170 git.c:440 trace: built-in: git clone git@*uni repo*.git
Cloning into 'uebungen'...
21:38:07.783173 run-command.c:663 trace: run_command: unset GIT_DIR; ssh git@*uni domain* 'git-upload-pack '\''*repo*.git'\'''
21:38:08.587244 run-command.c:663 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 14672 on Leo-PC' --check-self-contained-and-connected
21:38:08.602247 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
21:38:08.604247 trace.c:377 setup: git_dir: C:/Users/*removed*/uebungen/.git
21:38:08.604247 trace.c:378 setup: git_common_dir: C:/Users/*removed*/uebungen/.git
21:38:08.604247 trace.c:379 setup: worktree: C:/Users/*removed*
21:38:08.604247 trace.c:380 setup: cwd: C:/Users/*removed*
21:38:08.604247 trace.c:381 setup: prefix: (null)
21:38:08.604247 git.c:440 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 14672 on Leo-PC' --check-self-contained-and-connected
remote:
remote: Enumerating objects: 852, done.
(...) remote: Counting objects: 100% (852/852), done.
(...) remote: Compressing objects: 100% (373/373), done.
remote: Total 1208 (delta 508), reused 792 (delta 461)
Receiving objects: 100% (1208/1208), 6.24 MiB | 36.54 MiB/s, done.
Resolving deltas: 100% (680/680), done.
21:38:09.614724 run-command.c:663 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'
21:38:09.628565 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
21:38:09.630566 trace.c:377 setup: git_dir: C:/Users/*removed*/uebungen/.git
21:38:09.630566 trace.c:378 setup: git_common_dir: C:/Users/*removed*/uebungen/.git
21:38:09.630566 trace.c:379 setup: worktree: C:/Users/*removed*
21:38:09.630566 trace.c:380 setup: cwd: C:/Users/*removed*
21:38:09.630566 trace.c:381 setup: prefix: (null)
21:38:09.630566 git.c:440 trace: built-in: git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'
21:38:09.639568 chdir-notify.c:65 setup: chdir from 'C:/Users/*removed*' to 'C:/Users/*removed*/uebungen'
21:38:09.639568 chdir-notify.c:40 setup: reparent packed-refs to 'C:/Users/*removed*/uebungen/.git/packed-refs'
21:38:09.639568 chdir-notify.c:40 setup: reparent files-backend $GIT_DIR to 'C:/Users/*removed*/uebungen/.git'
21:38:09.639568 chdir-notify.c:40 setup: reparent files-backend $GIT_COMMONDIR to 'C:/Users/*removed*/uebungen/.git'
推荐答案
我已经解决了问题(目前),方法是降级到Windows 2.23.0的Git. 该问题在最新版本上仍然存在,并且可以在我的桌面上重现.
I've fixed the problem (for now), by downgrading to Git for Windows 2.23.0. The problem persists on the newest version and is reproducable on my desktop.
这篇关于Pycharm对Git感到奇怪(树条目中的文件名包含反斜杠)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!