๐Ÿš€ Growth/Troubleshooting

[Git Error] LF will be replaced by CRLF the next time Git touches it ํ•ด๊ฒฐ

devCloud 2023. 10. 29. 20:15
728x90

git add . ์‹œ ์—๋Ÿฌ

warning: in the working copy of 'ํŒŒ์ผ๊ฒฝ๋กœ', 
LF will be replaced by CRLF the next time Git touches it

 

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

$git config core.autocrlf true
$git config --global core.autocrlf true

global์€ ์‹œ์Šคํ…œ ์ „์ฒด์— ์ ์šฉ์‹œํ‚ฌ ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค.

ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์—๋งŒ ์ ์šฉ์‹œํ‚ค๊ณ  ์‹ถ๋‹ค๋ฉด --global์„ ์ œ๊ฑฐํ•˜๋ฉด ๋œ๋‹ค.

 

์—๋Ÿฌ ์ด์œ 

OS๋งˆ๋‹ค ์‚ฌ์šฉ๋˜๋Š” ์ค„๋ฐ”๊ฟˆ ๋ฌธ์ž์—ด์ด ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— git์—์„œ ์–ด๋–ค ์˜๋ฏธ๋กœ ๋ฐ›์•„๋“ค์—ฌ์•ผ ํ• ์ง€ ๋ชฐ๋ผ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜ํƒ€๋‚œ ๊ฒƒ์ด๋ผ๊ณ  ํ•œ๋‹ค.

 


[์ฐธ๊ณ ๋งํฌ] ๐Ÿ‘‡

 

[Git] LF will be replaced by CRLF in ์—๋Ÿฌ ํ•ด๊ฒฐ๋ฒ•

ํ‰์†Œ์™€ ๊ฐ™์ด git add .์„ ํ•˜๋Š” ์ˆœ๊ฐ„ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์ด๋Š” ์œˆ๋„์šฐ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋กœ, ๋งŒ์•ฝ ์œ ๋‹‰์Šค OS(๋งฅ)์„ ์“ฐ๊ณ  ์žˆ๋‹ค๋ฉด `LF`์™€ `CRLF`์˜ ์œ„์น˜๊ฐ€ ๋ฐ˜๋Œ€๋˜์–ด ๋‚˜์˜ฌ ๊ฒƒ์ด๋‹ค.

velog.io

 

728x90