Skip to content

Instantly share code, notes, and snippets.

@AWOL-TECH
Created July 21, 2023 14:10
Show Gist options
  • Save AWOL-TECH/09ba8128c4050930cad03172365358ea to your computer and use it in GitHub Desktop.
Save AWOL-TECH/09ba8128c4050930cad03172365358ea to your computer and use it in GitHub Desktop.
Change Line endings from dos to unix (CRLF to LF) with Git for Windows bash
# AWOL-TECH
#
# With Git for windows installed (https://gitforwindows.org/) navigate to your desired folder via explorer
# now open a Git Bash window from the right click context
#
# Now you can enter the line below to batch convert your files from CRLF to LF using dos2unix
# Dos2unix appears to be installed by default with git for windows.
#
# Have fun
find . -name "*" -exec dos2unix {} \;
# change "*" in the name part to match your files * will match everything
# e.g. -name "*.php" will match all your PHP files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment