GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cannot checkout repositories with relative symlinks in them · Issue #2107 · go-git/go-git

Cannot checkout repositories with relative symlinks in them #2107

New issue
Copy link
New issue
Copy link
Closed
Closed
Cannot checkout repositories with relative symlinks in them#2107
Copy link
Assignees
pjbgf
Labels
bugSomething isn't working

Description

@0xDEC0DE
0xDEC0DE
opened on May 12, 2026
Issue body actions

Bug Description

Attempting a checkout of a repo containing a relative symlink throws an error

Steps to reproduce

go run ./_examples/clone/main.go https://github.com/lorin/openstack-ansible-modules.git ~/Desktop/lolwut

Expected result

Repository is cloned and a worktree is created at ~/Desktop/lolwut

Actual behavior

git clone https://github.com/lorin/openstack-ansible-modules.git /Users/nic/Desktop/lolwut --recursive
error: symlink: invalid path "../keystone_service": cannot use ".."
exit status 1

Miscellany

  • In the test case, the culprit is this thing: https://github.com/openstack-ansible/openstack-ansible-modules/blob/master/tests/keystone_service.py
  • That repo is over a decade old at this point, so this very much expected to work / common behaviour
  • Symlinks pointing to other (relative) locations inside the worktree is 100% fine and should not throw errors
  • Symlinks pointing to relative locations from outside the worktree is arguably OK, too
  • Running the command the example emits on stdout works:
git clone https://github.com/lorin/openstack-ansible-modules.git /Users/nisimond/Desktop/lolwut --recursive
Cloning into '/Users/nic/Desktop/lolwut'...
remote: Enumerating objects: 565, done.
remote: Total 565 (delta 0), reused 0 (delta 0), pack-reused 565 (from 1)
Receiving objects: 100% (565/565), 170.64 KiB | 1.43 MiB/s, done.
Resolving deltas: 100% (304/304), done.

go-git Version

v6.0.0-20260511090450-983ee99d1198

Steps to Reproduce

go run ./_examples/clone/main.go https://github.com/lorin/openstack-ansible-modules.git ~/Desktop/lolwut

Additional Information

No response

Activity

  1. 0xDEC0DE
    added
    bugSomething isn't working
    on May 12, 2026
  2. AriehSchneier
    added 4 commits that reference this issue on May 12, 2026

    worktree: allow symlink targets containing ".."

    This issue will close once commit b04c8f2 is merged into the 'master' branch.
    b04c8f2

    worktree: filesystem, Allow symlink targets containing "..". Fixes go…

    This issue will close once commit 55f48d9 is merged into the 'master' branch.
    55f48d9

    git: Allow symlink targets containing "..". Fixes go-git#2107

    This issue will close once commit 96f6c7f is merged into the 'master' branch.
    96f6c7f

    git: Allow symlink targets containing "..". Fixes go-git#2107

    This issue will close once commit 6ab1ef9 is merged into the 'master' branch.
    6ab1ef9
  3. 0xDEC0DE commented on May 12, 2026

    @0xDEC0DE
    0xDEC0DE
    on May 12, 2026
    ContributorAuthor
    More actions

    This was introduced in commit 0ae66bd, which provided no explanation for the change, and deviates from the behaviour of plain Git.

  4. pjbgf
    self-assigned this
    on May 12, 2026
  5. pjbgf commented on May 12, 2026

    @pjbgf
    pjbgf
    on May 12, 2026
    Member
    More actions

    @0xDEC0DE thanks for filing this issue, we are looking into it and should get a fix shortly.

  6. pjbgf commented on May 12, 2026

    @pjbgf
    pjbgf
    on May 12, 2026
    Member
    More actions

    Closing as per changes in main and backported to v5.

  7. pjbgf
    closed this as completedon May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pjbgf
    pjbgf

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.