Skip to content

Can't sync repo with untracked files even after recommended stash #6910

@corneliusroemer

Description

@corneliusroemer

Describe the bug

gh version 2.21.2 (2023-01-03)

When trying to sync a repo that has untracked changes with gh repo sync I get an error:

$ gh repo sync
can't sync because there are local changes; please stash them before trying again

Now even after a stash, I get the same error again. So I'm stuck. The error message should offer me another tip that works:

$ git stash    
Saved working directory and index state WIP on master: da1928e8 chore(ci): remove gh auth status call

$ gh repo sync       
can't sync because there are local changes; please stash them before trying again

$  git status  
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        data/sars-cov-2/primers.csv
        data/sars-cov-2/qc.json
        data/sars-cov-2/tag.json
        data/sars-cov-2/tree.json
        data/sars-cov-2/virus_properties.json
        interesting.fa
        interesting.txt
        out.tsv
        out.tsv.zst
        output/
        profile.json
        sars.zip

nothing added to commit but untracked files present (use "git add" to track)

Steps to reproduce the behavior

  1. gh repo clone a repo
  2. Copy that repo to another folder
  3. Add some changes that are .gitignored
  4. gh repo sync observe result
  5. gh repo stash
  6. gh repo sync observe result

Expected vs actual behavior

I expect an error message that helps me resolve the problem, not one that doesn't.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions