git - Same change keeps reappearing after checkout -
git keeps adding same changeset, looks this:
@@ -1,12 +1,12 @@ -<?xml version="1.0" encoding="utf-8"?> -<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical" > - - <textview - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="@string/hello" /> - +<?xml version="1.0" encoding="utf-8"?> +<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" > + + <textview + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="@string/hello" /> + </linearlayout> \ no newline @ end of file the file not open in editor, , every time discard changes doing git checkoutor using github tool, changes reappear without me doing anything. committing files changes nothing, same changeset reappears immediately.
how keep doing this?
whole file changed? line endings! (read line endings!!!)
you can read git's manual on line ending conversion, github nice detailed explanation on this, put basically:
- your editor should use expected line endings (most people stick os default)
- your core.autocrlf in gitconfig should follow editor's option.
you might need issue commit fixing line issue if made commit wrong line ending (i.e. git repo should in lf).
Comments
Post a Comment