1

I'm on a feature branch, and have lots of uncommitted file changes that I don't recognize. I've tried running:

git reset --hard head
git stash

But the files are still showing as uncommitted changes.

Am I using the wrong commands?

Im working on a branch that someone has changed using a mac and I am on windows so I suspect it is a line ending issue

DavidB
  • 2,566
  • 3
  • 33
  • 63

1 Answers1

1

Looks like you probably have untracked files that you want to get rid of:

git clean -fd

Another (safer) approach if you think you may need those files back:

git stash -u
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
  • thanks, trying clean i get Deletion of directory '/aspnet_client/system_web/4_0_30319' failed. Should I try again? – DavidB Mar 16 '16 at 12:23
  • Are there restrictive permissions on that directory/file? Perhaps you need to manually delete it – Jonathan.Brink Mar 16 '16 at 12:27
  • Ive managed to delete the folder, ran both commands, which run successfully but the uncommited changes are still there – DavidB Mar 16 '16 at 12:38
  • This may be a windows issue...are you using sourcetree? Does this question help? http://stackoverflow.com/questions/15958446/sourcetree-app-says-uncommitted-changes-even-for-newly-cloned-repository-what – Jonathan.Brink Mar 16 '16 at 12:39
  • No im using bash, i tried in sourcetree but no luck - ill check your link out now cheers – DavidB Mar 16 '16 at 12:40
  • Nothing seemed to work. I just deleted the repo and cloned it again. Thanks for the help – DavidB Mar 16 '16 at 13:07
  • @Linda - :) I've seen that before and it did come to mind as I was doing it! – DavidB Mar 16 '16 at 13:58
  • @DavidB Yeah, I try find the proper way to do things idiomatically in git most of the time -- but there have been situations where I just said "screw it" and cloned a fresh repo. :) – LindaJeanne Mar 16 '16 at 14:50