Skip to content

Describe workaround for cloning with long file names on Windows#4198

Merged
jurre merged 2 commits intodependabot:mainfrom
Marcono1234:patch-1
Oct 11, 2021
Merged

Describe workaround for cloning with long file names on Windows#4198
jurre merged 2 commits intodependabot:mainfrom
Marcono1234:patch-1

Conversation

@Marcono1234
Copy link
Copy Markdown
Contributor

Relates to #3676

On Windows cloning the repository might fail with "Filename too long". This pull request adds a section to the README explaining how to solve this.

@Marcono1234 Marcono1234 requested a review from a team as a code owner September 3, 2021 20:16
@Marcono1234 Marcono1234 marked this pull request as draft September 3, 2021 20:49
@Marcono1234
Copy link
Copy Markdown
Contributor Author

Hmm git restore --source=HEAD :/ is suggested to me by Git after the checkout failed:
Git error message

However, it does not seem to work. git status still reports changes afterwards.
Using git reset --hard works.

Have marked this pull request as draft for now, until it is clear what the proper command is (and have asked on StackOverflow about this).

@jurre
Copy link
Copy Markdown
Member

jurre commented Sep 6, 2021

Thanks @Marcono1234, this would be a great addition to the docs. None of the maintainers work on Windows so the contribution is very much appreciated, lmk if I can help in any way.

@Marcono1234
Copy link
Copy Markdown
Contributor Author

I would like to wait a few days to get an answer on the StackOverflow question or from the Git for Windows maintainers whether git restore --source=HEAD :/ (as currently suggested by Git) is indeed the "correct" command and there is a bug in Git for Windows.
In case I don't receive a definite response there I will edit this pull request to recommend git reset --hard instead.

@jurre
Copy link
Copy Markdown
Member

jurre commented Oct 8, 2021

@Marcono1234 did you ever end up getting a reply? I'm happy to find someone internally at GitHub who can answer the q if not!

`git restore --source=HEAD :/` which is currently suggested by Git does not work,
it is unable to restore the files, see git-for-windows/git#3411.
@Marcono1234
Copy link
Copy Markdown
Contributor Author

I did receive a reply and with some delay on my side posted this issue to the Git mailing list. However, it probably takes some time until this is resolved, so the easiest solution might be to recommend git reset --hard for now (which I changed with the latest commit).

Sorry that I did not inform you about the progress.

@Marcono1234 Marcono1234 marked this pull request as ready for review October 11, 2021 01:33
@jurre jurre merged commit a6a8292 into dependabot:main Oct 11, 2021
@Marcono1234 Marcono1234 deleted the patch-1 branch October 11, 2021 12:45
@jurre jurre mentioned this pull request Oct 14, 2021
@brrygrdn brrygrdn mentioned this pull request Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants