반응형
추적되지 않은 파일을 제거하도록 git에게 알립니다.
git에게 untrack 파일을 제거하도록 지시 할 수 있습니까? 주로 인기있는 것입니까?
예 :
git checkout -- index.php <-- revert my file
git checkout -- master <-- this would revert the entire repo back to the last commit on master, removing (deleting) any and all untracked files as well as reverting committed ones.
나는 이것이 쉘에서 사소한 할 일이라는 것을 알고 있다는 것을 Git에서 할 수 있는지 알고 싶습니다.
를 찾고 있습니다 git clean
. 추적되지 않은 모든 파일이 삭제됩니다. 기본적으로 이것은 무시되지 않습니다. .gitignore
하지만 git clean -x
해당 파일도 정리합니다.
로부터 git clean
매뉴얼 페이지
-x
Don't use the ignore rules. This allows removing all untracked
files, including build products. This can be used (possibly in
conjunction with git reset) to create a pristine working directory
to test a clean build.
필요한 경우 디렉토리에있는 파일을 현재 위치에서 제거 할 git clean
항목 -df
을 추가 해야합니다 . x
된 파일을 무시 포함하려면 추가 합니다.
따라서 소스 제어에있는 그대로 남기고 작업을 정리 한 다음 명령을 실행하십시오.
git clean -xdf
참고 URL : https://stackoverflow.com/questions/7588268/telling-git-its-ok-to-remove-untracked-files
반응형
'ProgramingTip' 카테고리의 다른 글
URL을 사용하여 원격 서버에 파일이 있는지 확인 (0) | 2020.12.11 |
---|---|
codeigniter의 활성 레코드 구문을 사용하여 mysql 데이터베이스의 증가 필드 (0) | 2020.12.11 |
Android Studio에서 실행에 빌드 변형을 가져 오는 방법은 무엇입니까? (0) | 2020.12.11 |
ES6 배열 기본 변수 (0) | 2020.12.11 |
-fembed-bitcode는 iOS 6.0 이전 버전에서 지원되지 않습니다. (0) | 2020.12.11 |