NullPointer
NullPointer

Reputation: 152

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.

Upvotes: 0

Views: 361

Answers (2)

NullPointer
NullPointer

Reputation: 152

The issue was related to filemode . I have made filemode=false . Please have a look on below link How do I make Git ignore file mode (chmod) changes?

Upvotes: 0

Subash J
Subash J

Reputation: 2048

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 fetch will update the list of changes.

Upvotes: 2

Related Questions