0

I have just cloned the repo from a project I'm working on. We clone from the *master but then I need to checkout and create a local dev branch as the is what we commit our code to and the *master is locked to commits. As soon as the clone finished I did git status and find that there is a

user@directory:~/dirName/dirName$git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working 
directory)

modified:   .htaccess

file that is downloaded as well. I made no changes to this file, I haven't even opened a single file yet.

I need to do a git checkout -b dev origin/dev to create a local branch of origin/dev but this file is stopping me from doing it.

I have done a git stash and it won't stash. I have tried to assume-unchanged and this still won't allow the checkout to take place. I have also tried to do the git checkout .htaccess and this does nothing. It's also not a file I can commit or push as we can't push to the master. I also did a hard reset. I have looked and looked but cannot find this particular scenario.

Is there a way to force the checkout so I can create the /dev branch and make it my default? Or how can I clear this file out?

I truly appreciate any inputs or guidance as I've not run across this before. Thank you!

Oh and I use git via CLI not any GUI's.

bahrep
  • 29,961
  • 12
  • 103
  • 150
Jana
  • 29
  • 1
  • 7

1 Answers1

1

Try and clone again, after typing:

git config --global core.autocrlf false

If the same file is still "modified", check the git diff output to see what kind of difference it has with the HEAD.
Another possible diff reason would be a permission one.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250