windows는 기본적으로 개행을 \r\n, 리눅스나 맥은 \n으로 처리한다.

기본 설정에서 git은 개행의 차이를 감지해서 변화가 없는 파일까지 modified로 잡힐 때가 있다.

이런 문제를 피하고 싶을때 git을 설치하고 처음으로 아래 명령어를 실행 시켜주면 개행 문자를 통일할수 있다.


1.git config --global core.eol lf

line ending을 LF로 처리 한다.


2.git config --global core.autocrlf input

line ending을 LF로 처리 한다.


3. git config --global core.autocrlf true

check out, check in 할때 crlf를 LF로 바꿔서 저장, LF를 crlf로 변환하여 불러오기를 한다.


윈도우즈 일경우 1,3번 맥과 리눅스일 경우 1번과 2번을 사용하면 좋다.

git config --system core.longpaths true
git remote add origin https://github.com/user/repo2.git
git remote set-url origin https://github.com/user/repo2.git

find . -type d -empty -exec touch {}/.gitignore \;

직전 커밋 되돌리기

git reset HEAD^


커밋 두개 되돌리기

git reset HEAD~2

git reset HEAD^
git push origin -f

+ Recent posts