From 32ecb98410b05155e85b1475e8c0829e5a98cda5 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Fri, 3 Sep 2021 22:13:19 +0200 Subject: [PATCH 1/2] Describe workaround for cloning with long file names on Windows --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index f82e864383..9236c82fe7 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,21 @@ In addition to this library, you may be interested in: GitLab or Azure DevOps - The [API docs][api-docs] for Dependabot's hosted instance (dependabot.com) +## Cloning the repository +Clone the repository with Git using: + +``` +git clone https://github.com/dependabot/dependabot-core.git +``` + +On Windows this might fail with "Filename too long". To solve this, run the +following commands in the cloned Git repository: + +1. `git config core.longpaths true` +2. `git restore --source=HEAD :/` + +You can read more about this in the [Git for Windows wiki](https://github.com/git-for-windows/git/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path). + ## Setup To run all of Dependabot Core, you'll need Ruby, Python, PHP, Elixir, Node, Go, From 319863e67b35620bababe1c97f00004c6ee17356 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Mon, 11 Oct 2021 03:29:14 +0200 Subject: [PATCH 2/2] Recommend `git reset` when cloning repository on Windows fails `git restore --source=HEAD :/` which is currently suggested by Git does not work, it is unable to restore the files, see https://github.com/git-for-windows/git/issues/3411. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9236c82fe7..c77adccfa1 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ On Windows this might fail with "Filename too long". To solve this, run the following commands in the cloned Git repository: 1. `git config core.longpaths true` -2. `git restore --source=HEAD :/` +2. `git reset --hard` You can read more about this in the [Git for Windows wiki](https://github.com/git-for-windows/git/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path).