Skip to content

push: config.yaml from unpushed local commits still reaches the remote's history #366

Closed

Description

@runkids

Problem

At git_root: root, push keeps config.yaml out of version control: rootScopeSafetySweep (cmd/skillshare/gitroot.go:106) calls EnsureConfigUntracked (internal/git/scope.go:226), which runs git rm -r --cached config.yaml and commits the removal.

This only removes the file from the new commit. If a local, not-yet-pushed commit already tracks config.yaml (for example, it was force-added by mistake), push adds a "stop tracking" commit on top and pushes both. The machine-specific config.yaml, with its local paths, then stays in the remote's history.

Repro

  1. Root scope repo with an upstream, config.yaml in .gitignore.
  2. git add -f config.yaml && git commit -m oops (do not push).
  3. skillshare push.
  4. The remote's history contains the oops commit, which includes config.yaml.

Options

  • Before pushing, detect local commits ahead of @{u} that touch config.yaml and refuse, telling the user how to rewrite them (e.g. an interactive rebase or git commit --amend).
  • Or offer to rewrite those unpushed commits. Riskier: Skillshare never rewrites history today.

Related: #353, #357, #362.

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