We were facing the problem with 'EGit- Synchronize workspace' which showed all the files as changed, even if we haven't changed the content of those files. This happened only when we clone/ pull the repository using Git bash (Unix bash prompt). As we all know the reason for this problem - Windows uses both a carriage-return character and a linefeed character for newlines in its files, whereas Linux/ Mac use only the linefeed character.
Git Hub provides some configurations to override these cross-platform issues.
Do the following before cloning the remote repository, I have the folder structure as C:\Git\Project\, where I would clone the repository inside this folder.
Do the following before cloning the remote repository, I have the folder structure as C:\Git\Project\, where I would clone the repository inside this folder.
- Open Git bash at C:\Git\Project\
- Enter, git config --system core.autocrlf true and click enter
- Enter, git config --system core.whitespace cr-at-eol and click enter
- Then clone the repository as usual, git clone 'https://github.com/xxxxx/xxxx.git'
- Then open the local repository in your Eclipse and import projects.
- Right click on your projects > Team > Share to Git
- Right click on your projects > Team > Synchronize workspace
- In your Team Synchronize perspective, check the list of modified files. No files will be shown.
To know more about the commands that we used in step 2 and 3, refer http://git-scm.com/book/en/Customizing-Git-Git-Configuration
No comments:
Post a Comment