git - Switch between branches gives me error -
every time switch between branches error.
i've done couple of times:
https://help.github.com/articles/dealing-with-line-endings
git rm --cached -r . # remove index. git reset --hard # write both index , working directory git's database. git add . # prepare make commit staging files normalized. # chance inspect files never normalized. should # lots of messages like: "warning: crlf replaced lf in file." git commit -m "normalize line endings" # commit
and problem still occurs.
my .gitattribute file looks this:
# set default behaviour, in case users don't have core.autocrlf set. * text=auto # explicitly declare text files want normalized , converted # native line endings on checkout. *.c text *.h text # declare files have crlf line endings on checkout. *.sln text eol=crlf # denote files binary , should not modified. *.png binary *.jpg binary
i error:
"error: local changes following files overwritten checkout:"
error: local changes following files overwritten checkout:
this occurs because files have not been committed repository. git add .
adds tracked files in current directory. fix this, could:
- add each file manually (
git add <file>
), giving full path file, - use
git add -a
.
here man-page git-add
.
Comments
Post a Comment