
- Git Tutorial
- Git - Home
- Git - Basic Concepts
- Git - Environment Setup
- Git - Life Cycle
- Git - Create Operation
- Git - Clone Operation
- Git - Perform Changes
- Git - Review Changes
- Git - Commit Changes
- Git - Push Operation
- Git - Update Operation
- Git - Stash Operation
- Git - Move Operation
- Git - Rename Operation
- Git - Delete Operation
- Git - Fix Mistakes
- Git - Tag Operation
- Git - Patch Operation
- Git - Managing Branches
- Git - Handling Conflicts
- Git - Different Platforms
- Git - Online Repositories
- Git Useful Resources
- Git - Quick Guide
- Git - Useful Resources
- Git - Discussion
- Git - Persian Version
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Git - Different Platforms
GNU/Linux and Mac OS uses line-feed (LF), or new line as line ending character, while Windows uses line-feed and carriage-return (LFCR) combination to represent the line-ending character.
To avoid unnecessary commits because of these line-ending differences, we have to configure the Git client to write the same line ending to the Git repository.
For Windows system, we can configure the Git client to convert line endings to CRLF format while checking out, and convert them back to LF format during the commit operation. The following settings will do the needful.
[tom@CentOS project]$ git config --global core.autocrlf true
For GNU/Linux or Mac OS, we can configure the Git client to convert line endings from CRLF to LF while performing the checkout operation.
[tom@CentOS project]$ git config --global core.autocrlf input
Advertisements