최신 코드로 업데이트하는 repo sync 명령어

Android 처럼, repo로 소스를 관리하는 프로젝트들이 있습니다.

repo 프로젝트에서 최근에 추가된 commit을 다운로드 받을 때 유용한 명령어 몇개를 소개합니다.

repo sync -d

git의 branch의 head를 repo의 Manifest에 지정된 것으로 변경하고 코드를 다운로드합니다.

작업하면서 branch를 새로 만들고, head 위치를 변경했을 때, 이런 것들을 다시 Manifest의 head로 변경해 줍니다.

repo sync -d 명령어 실행 전

$ git branch
* curent_branch

repo sync -d 실행 후, head가 변경됨

$ git branch
* (detached from 715faf5)

repo forall -c 'git reset --hard'

모든 working directory의 수정사항을 삭제합니다.

$ repo forall -c 'git reset --hard'

repo forall -c ‘git clean -f -d’

모든 untracked file을 삭제합니다.

$ repo forall -c ‘git clean -f -d’
Loading script...

Related Posts

codechachaCopyright ©2019 codechacha