Skip to content

[Bug] Codespaces environment missing git-lfs causing push failures in LFS-enabled repository #174

@naoki1213mj

Description

@naoki1213mj

Issue Summary

When using this repository in GitHub Codespaces, users encounter git push failures due to Git LFS not being pre-installed in the Codespaces environment at exercise2.

Problem Description

After completing the learning activities and attempting to push changes, users get the following error:

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').

Steps to Reproduce

  1. Fork this repository
  2. Open in GitHub Codespaces
  3. Complete the learning activities and make commits
  4. Run git push
  5. Error occurs

Current Workaround

Users need to manually install Git LFS:

sudo apt update && sudo apt install -y git-lfs
git lfs install --force
git push

Suggested Solutions

Option 1: Add to devcontainer configuration

Add Git LFS installation to .devcontainer/devcontainer.json:

{
  "postCreateCommand": "sudo apt update && sudo apt install -y git-lfs && git lfs install"
}

Option 2: Update documentation

Add a troubleshooting section to the README explaining this issue and the workaround.

Option 3: Remove Git LFS if not needed

If Git LFS isn't essential for this learning repository, consider removing the LFS configuration to simplify the user experience.

Impact

This affects learners trying to complete the "Code with Codespaces" skill, potentially causing frustration when they can't push their completed work.

Environment

  • GitHub Codespaces (Debian-based environment)
  • Git LFS hooks are present but git-lfs command is not installed by default

Metadata

Metadata

Assignees

No one assigned

    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