Skip to content

[bug] git history lost on remixed projects #7

Open

Description

@bidah

There is a fact that whenever we use the remix feature ref: https://github.com/react-native-vibe-code/react-native-vibe-code-sdk/tree/main/packages/remix The flow for remixing works on the new user and it gets the code base with the last history as it should, but whenever a new change is done by prompting to the chat, the change happens. But the git commit does not. So in the back, we are on the sandbox and the changes to code are being made, but the commit for the last changes of that prompt in the remix code base are not being applied. fix.

Activity

  1. bidah commented on Feb 23, 2026

    @bidah
    CollaboratorAuthor

    @claude implement fix to this

  2. claude commented on Feb 23, 2026

    @claude

    Claude finished @bidah's task in 7m 50s —— View job • claude/issue-7-20260223-1021 • Create PR ➔


    Implementing fix for git history lost on remixed projects

    • Gather context and explore codebase
    • Understand the request
    • Identify root cause of git commits not being applied in remixed projects
    • Implement fix
    • Commit and push changes

    Root Cause Analysis

    Two bugs caused git commits to silently fail after remixing a project:

    Bug 1 — Wrong git remote after sandbox-copy fallback (remix-handler.ts Option 2)

    When GitHub clone fails and the fallback path copies files via tarball, the tarball includes the source project's .git directory. The git remote add origin ... || true then silently fails (origin already exists pointing to the source repo). All subsequent commitAndPush calls push to the wrong repository.

    Fix: Remove .git and run a clean git init in the extract script before setting up the new remote.

    Bug 2 — commitAndPush never verifies the remote URL (github-service.ts)

    The commitAndPush method receives repositoryName as a parameter but never used it — it trusted whatever remote was already in the sandbox. For a remixed sandbox with an incorrect or stale remote, all pushes silently failed (the caller uses fire-and-forget so errors were never surfaced).

    Fix: Add git remote set-url || git remote add with the correct authenticated URL (owner + token + repositoryName) before every commit. Also switched from git push origin main to git push origin HEAD:main to handle cases where the local branch is named master (older git defaults).

    Changes Made

    File Change
    packages/remix/src/api/remix-handler.ts Extract script: rm -rf .git && git init instead of git init || true
    packages/sandbox/src/lib/github-service.ts commitAndPush: set correct remote URL before push; use HEAD:main refspec

    |

  3. added a commit that references this issue on Feb 23, 2026
    df1fddc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions