git init

1 개요[ | ]

git init
  • 빈 Git 저장소를 생성하거나 기존 저장소를 초기화하는 명령어

2 실습[ | ]

root@zetawiki:~# mkdir -p workspace/hello
root@zetawiki:~# cd workspace/hello/
root@zetawiki:~/workspace/hello# git init
Initialized empty Git repository in /root/workspace/hello/.git/

3 확인[ | ]

root@zetawiki:~/workspace/hello# tree -aF
.
└── .git/
    ├── branches/
    ├── config
    ├── description
    ├── HEAD
    ├── hooks/
    │   ├── applypatch-msg.sample*
    │   ├── commit-msg.sample*
    │   ├── post-update.sample*
    │   ├── pre-applypatch.sample*
    │   ├── pre-commit.sample*
    │   ├── prepare-commit-msg.sample*
    │   ├── pre-push.sample*
    │   ├── pre-rebase.sample*
    │   └── update.sample*
    ├── info/
    │   └── exclude
    ├── objects/
    │   ├── info/
    │   └── pack/
    └── refs/
        ├── heads/
        └── tags/

10 directories, 13 files
→ 맨뒤에 /가 붙은 것은 폴더, 그렇지 않은 것은 파일
root@zetawiki:~/workspace/hello# git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)
root@zetawiki:~/workspace/hello# git show
fatal: bad default revision 'HEAD'
root@zetawiki:~/workspace/hello# git log
fatal: bad default revision 'HEAD'

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}