방금 리눅스 커널 코드를 복제 한 다음 새로운 지점으로 체크 아웃하려고 시도했을 때 로컬 변경으로 인해 실패했습니다.새로 복제 된 git repo에서 새로운 지점으로 체크 아웃 할 수 없습니다.
새로 복제 된 코드가 소위 로컬 변경을 할 수있는 이유가 혼란 스럽습니다. 결국 로컬 변경 사항을 삭제하기 위해 강제로 새 지점을 체크 아웃하기 위해 "git checkout -f -b xxx
"을 사용하지만 강제로보다는 성공적으로 체크 아웃하는 우아한 방법이 있는지 궁금해합니다.
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Cloning into 'linux-stable'...
remote: Counting objects: 5253622, done.
remote: Compressing objects: 100% (1189462/1189462), done.
remote: Total 5253622 (delta 4399195), reused 4796362 (delta 4030229)
Receiving objects: 100% (5253622/5253622), 1005.30 MiB | 576.00 KiB/s, done.
Resolving deltas: 100% (4399195/4399195), done.
Checking connectivity... done.
Checking out files: 100% (54401/54401), done.
$cd linux-stable
$ git checkout -b linux-4.2.y origin/linux-4.2.y
error: Your local changes to the following files would be overwritten by checkout:
include/uapi/linux/netfilter/xt_RATEEST.h
net/netfilter/xt_TCPMSS.c
Please, commit your changes or stash them before you can switch branches.
Aborting
$ git checkout -f -b linux-4.2.y origin/linux-4.2.y
Checking out files: 100% (28688/28688), done.
Branch linux-4.2.y set up to track remote branch linux-4.2.y from origin.
Switched to a new branch 'linux-4.2.y'
당신이 체크 아웃을 방지 변경 사항을 무엇인지 확인 했 :
은 구체적 목표 지점으로 복제,이 합병증을 방지하려면? 나는 "broken"라인 엔딩 ('\ n'vs '\ r \ n')을 의심한다. – user3159253