Skip to content

Conversation

@breezytm
Copy link

Issue

The Docker build was failing during git checkout due to missing Git tags:

error: pathspec 'v1.101603.1' did not match any file(s) known to git
error: pathspec 'op-node/v1.14.1' did not match any file(s) known to git

Solution

This issue occurred because git clone does not automatically fetch all tags, especially when the tags are lightweight or not associated with the default branch. As a result, the requested tag could not be found during checkout.

To resolve this, we explicitly fetch all tags before checking out the version and use the full tags/<tag> path to ensure Git interprets it correctly.

Changes

  • Added git fetch --tags before each git checkout to retrieve all remote tags.
  • Updated git checkout commands to use the full path: git checkout "tags/${VERSION}".

The build was failing with the error: ```error: pathspec 'v1.101603.1' did not match any file(s) known to git```

This occurred because `git clone` does not fetch all tags by default, and the tag `v1.101603.1` was not available in the local repository context.

To fix this, added `git fetch --tags` before the checkout and used the explicit `tags/` namespace to ensure the tag is recognized.
Resolved an error during the Docker build: ```error: pathspec 'op-node/v1.14.1' did not match any file(s) known to git```

This was caused by attempting to checkout a tag before fetching all tags from the remote repository. By default, `git clone` does not retrieve all tags unless explicitly requested.

Added `git fetch --tags` before the checkout command and used the full tag path `tags/op-node/$OPNODE_VERSION` to ensure the reference is correctly resolved.
Copy link
Collaborator

@ihooni ihooni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing

ARG OPGETH_VERSION

RUN git checkout $OPGETH_VERSION
RUN git fetch --tags && git checkout "tags/${OPGETH_VERSION}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about clone with single branch?

> git clone https://github.com/ethereum-optimism/op-geth.git --branch v1.101603.1 --single-branch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should work

RUN git clone --branch ${OPGETH_VERSION} --single-branch https://github.com/ethereum-optimism/op-geth.git

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