1

First of all, I'm new to git. I'm working on a branch (not master) and regularly merge with another branch. A few hours ago, everything was working fine, but I came across a problem.

I compared by using: git diff bc_integration origin/feature/ui in bash (WSL).

    diff --git a/js/bootstrap-datepicker.js b/js/bootstrap-datepicker.js
    index 41c1b42..f17de6d 100644
    --- a/js/bootstrap-datepicker.js
    +++ b/js/bootstrap-datepicker.js
    @@ -1,1671 +1,1671 @@
-/* =========================================================
- * bootstrap-datepicker.js
- * Repo: https://github.com/eternicode/bootstrap-datepicker/

The problem is I have two identical files but "diff" marks them as different. Not sure what is happening, but it may be related to me creating a backup folder, and replace my working directory with this backup (including the .git folder).

Marcellvs
  • 391
  • 1
  • 3
  • 15
  • Okay, I did some testing, hashes are different (as shown in the above field), file sizes too. I think it might have something to do with CRLF and LF. Not sure how to fix it though or why git didn't properly convert. – Marcellvs Mar 19 '19 at 16:15
  • I know think it is because I commited in Visual Studio Code and then again tested "git status" in bash and it showed me that many files were not staged, so I added them. And that is probably because VSC *will* convert CRLF to LF when pushing, but locally, there are still differences which bash recognizes. – Marcellvs Mar 20 '19 at 09:50
  • Probably line ending difference: https://stackoverflow.com/questions/3920650/git-diff-show-me-line-ending-changes – Deniz Mar 26 '19 at 20:57

1 Answers1

0

According to your case I think your that file permissions has been changed with last commit. check file permission from following command in terminal:

ll

or

ls -al

Anyway please check your file permissions or if you didn't do any change with in that file you can reset it as last commit using :

git checkout js/bootstrap-datepicker.js
kavindalb
  • 11
  • 3