0

I did the following steps:

git clone my/repo && cd my/repo
git remote add other some/remote
git fetch --all --prune --tags
git checkout -b newbranch
git reset --hard other/newbranch

and now there's an unstaged file. There are no .gitattribute files in this repo in any branch or remote. (So it's not the same as Unstaged changes left after git reset --hard)

Edit

If I do

git checkout -b newbranch other/newbranch

instead of the last two lines, I still have the unstaged file.

What could cause this?

Community
  • 1
  • 1
kojiro
  • 74,557
  • 19
  • 143
  • 201
  • The likely issue is that your local `newbranch` isn't synced up to `other/newbranch`. Could you try instead `git checkout newbranch other/newbranch` (after nuking your existing local branch)? – Makoto Oct 16 '15 at 15:43
  • @Makoto Edited the question to include that. I assumed you meant `git checkout -b` – kojiro Oct 16 '15 at 18:42
  • No, I imagine that `-b` is just going to create a new, untracked branch which happens to share a name with your remote branch. I actually *did* mean `git checkout`. – Makoto Oct 16 '15 at 19:52

0 Answers0