더북(TheBook)

master 가지로 이동하고 불필요해진 가지를 삭제합니다.

administrator@vmgate:~/code/environments/production$ git checkout master
administrator@vmgate:~/code/environments/production$ git branch -d iss02
administrator@vmgate:~/code/environments/production$ git branch -d iss01

커밋 목록은 생각했던 대로 정리된 상태입니다.

administrator@vmgate:~/code/environments/production$ git log --oneline
4f145da (HEAD -> master) Finish fortunecow
62721ff Create motd.pp of fortunecow
c881532 Test fortunecow on vm03
9cda602 Create fortunecow module
4fe8cdf First commit

➊ 커밋을 되돌렸지만 커밋 이후에 작성한 파일과 디렉터리는 그대로 남아 있습니다. ➋ '초보 시스템 관리자의 일기 | 자동 설치 문제 해결하기'에서 설명했듯이 아무 옵션 없이 git reset을 실행하면 커밋 이후 변경된 파일은 작업 디렉터리에 남고, 새로 생성했던 danger_module 디렉터리는 추적하지 않는 상태로 존재합니다.

administrator@vmgate:~/code/environments/production$ ls modules ➊
apache apt base concat danger_module fortunecow mysql stdlib webapp
administrator@vmgate:~/code/environments/production$ git status ➋
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   manifests/site.pp

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        modules/danger_module/

no changes added to commit (use "git add" and/or "git commit -a")