Eclipse and Git command line are showing different status for files

Multi tool use
Eclipse and Git command line are showing different status for files
I have recently migrated to GIT from SVN and in the learning phase.
I am working on a change and for that I have created a new branch as below with eclipse option as:
Right click on project-->Team-->Switch To-->New Branch
New branch name :
feature/Fix-Issues
Say for instance, I have modified two files as part of the fix as :
A.java
B.java
After doing my changes, I have committed the files with eclipse 'Commit and Push'.
I can see a new entry has been added in the history. So far so good.
I am using Cygwin for using git commands. In order to verify that I have checked out to my feature branch, I have issued below command:
git branch
Which says that I am checked out to my feature branch (feature/Fix-Issues).
Now, if I ran below command:
git status
It returns as Changes not staged for commit :
modified:<package>/A.java
modified:<package>/B.java
I am not able to understand this part as I have checked in the files from Eclipse and have successful commit message in the history as well.
Any lead would be really helpful.
No, the same repository has not been cloned anywhere.
– NullPointer
Jul 2 at 12:34
Did you add those two files before you Commit and Pushed?
– nitind
Jul 2 at 13:35
Yes, Files are present as I can see in the history.
– NullPointer
Jul 2 at 14:06
This sounds like an end-of-line (CRLF) issue. It's possible Eclipse is going behind Git's back and defeating Git's detection that work-tree files with CRLF endings are actually the same as index versions that have LF-only endings.
– torek
Jul 2 at 16:22
2 Answers
2
Since you were saying like you haven't cloned the same repository anywhere else. It might be because of the local repository not updated properly. Try the following options:
1. Updating the branch
git checkout your_branch
2. Take a pull/fetch
git pull
will pull the latest changes.
git pull
git fetch
will update the list of changes.
git fetch
git pull : returns Already up to date. git fetch : executed successfully with out any messsage. Run git status shown same message Changes not staged for commit
– NullPointer
Jul 2 at 14:06
The issue was related to filemode . Please have a look on below link How do I make Git ignore file mode (chmod) changes?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Do you have the same repository being cloned in other places anywhere?
– Subash J
Jul 2 at 12:31