"Git init"의 두 판 사이의 차이

 
(사용자 3명의 중간 판 18개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
{{소문자}}
;git init
;git init
* 빈 Git 저장소를 생성하거나 초기화하는 명령어
* 빈 Git 저장소를 생성하거나 기존 저장소를 초기화하는 명령어
<source lang='cli'>
testuser@zetawiki:~$ mkdir workspace
testuser@zetawiki:~$ cd workspace
testuser@zetawiki:~/workspace$ mkdir hello
testuser@zetawiki:~/workspace$ cd hello
testuser@zetawiki:~/workspace/hello$ git init
Initialized empty Git repository in /home/testuser/workspace/hello/.git/
</source>
<source lang='cli'>
testuser@zetawiki:~/workspace/hello$ tree .git
.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


9 directories, 13 files
==실습==
</source>
<syntaxhighlight lang='console'>
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/
</syntaxhighlight>
 
==확인==
<syntaxhighlight lang='console'>
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
</syntaxhighlight>
:→ 맨뒤에 /가 붙은 것은 폴더, 그렇지 않은 것은 파일
<syntaxhighlight lang='console'>
root@zetawiki:~/workspace/hello# git status
On branch master
 
Initial commit
 
nothing to commit (create/copy files and use "git add" to track)
 
</syntaxhighlight>
<syntaxhighlight lang='console'>
root@zetawiki:~/workspace/hello# git show
fatal: bad default revision 'HEAD'
root@zetawiki:~/workspace/hello# git log
fatal: bad default revision 'HEAD'
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[git]]
*[[git config]]
*[[git status]]
*[[git add]]
*[[git commit]]
*[[Git 명령어]]
* [https://git-scm.com/docs/git-init Git - git-init Documentation]
* [https://www.lainyzine.com/ko/article/git-init-how-to-initialize-git-repository/ git init 사용법: Git 저장소를 생성(초기화)하는 방법]


[[분류: git]]
[[분류: git]]

2022년 3월 7일 (월) 03:09 기준 최신판

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 }}