4
donuts
5y

I was doing something in Git, switching and I guess another process was doing a fetch and now all the files no meter what bench I'm in says Unstaged/Untracked.

I tried deleting the main branch and checking it out again from remote but nothing.

I have no idea what I did or how to fix... Seems like I need to delete the whole folder... But then I'd lose any changes in feature branches out local branches which afternoon checked in....

Comments
  • 2
    Git stash
    Git pull
    Git stash apply

    This will "hide" your changes without a new branch, let you pull down to fix your repo, and then apply your changes back over the top unless there's conflicts.
  • 0
    @C0D4 but there are no changes, they're all be files now. So stash would do nothing?

    Restate PC, could be a hung git process fighting with SourceTree GUI...
  • 2
    @billgates oh there's a GUI involved.

    Could be a hung process or it somehow managed to roll back the HEAD, have you tried killing sourcetree and checking with terminal, does your work even exist in those files (most recent changes)?
    If it does, resaving those files (or add a space somewhere) might have it track the changes again.
  • 1
    @C0D4 tea didn't work because there are no local changes anymore. All the files are just ? State
  • 2
    @billgates
    Reindexing manually might be the go.

    # git update index --really-refresh

    https://git-scm.com/docs/...
  • 2
    @C0D4 found some gist which somehow fixed it...

    git clean -f -d

    Only removed the few really Untracked files... Not the other 3000+ source files it originally reported as Untracked
  • 2
    @billgates 🤔that's one way to do it.
    Hopefully you didn't loose much.
  • 1
    @C0D4 yes lucky I was doing branch cleanup (too many old branches) so I think everything was checked in.

    What I was worried was if I had to delete and pull the whole folder from remote, then I would lose all local only branches
Add Comment