honey_pot

[Git] cmd/bash로 첫 커밋하기 본문

기타

[Git] cmd/bash로 첫 커밋하기

_tera_ 2021. 5. 28. 01:33

출처 : https://tutorial.djangogirls.org/ko/deploy/

 

 

장고걸스 튜토리얼대로 하는게 가장 간단하고 쉽다


 

Git 저장소 만들기

1.

$ git init

Initialized empty Git repository in ~/폴더명/.git/

$ git config --global user.name "Your Name"

$ git config --global user.email you@example.com

 

*필요한 경우 .gitignore 파일 만들기 -> 해당 폴더 최상위에 저장해야함

from django girls tutorial

 

 

2.

$ git status

On branch master

No commits yet

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

    .gitignore

    gitignore에 있는 파일명

nothing added to commit but untracked files present (use "git add" to track)

 

-git status명령은 미추적/수정된/스테이지된 파일, 브랜치 상태와 그 외 많은 정보를 보여준다. 

 

3.

$ git add --all .

$ git commit -m "커밋 메시지"

[...]

13 files changed, 200 insertions(+)

create mode 100644 .gitignore

[...]

create mode 100644 mysite/wsgi.py


GitHub에 코드 배포하기

1. Github 에서 new repository로 레포를 만든다 (gitignore, README 파일을 생략하거나 선택한다)

2. Quick setup 부분에서 HTTPS 주소를 복사한다.

from django girls tutorial

3.

$ git remote add origin https://github.com/깃허브 username/repository 이름.git

$ git push -u origin master

 

4.

from django girls tutorial

장고걸스 -> cmd 창에 이런 내용이 출력되면 자기 정보 입력하고 해당 repo 확인

나는 인증토큰 or 깃허브웹에서 로그인해서 연결하기 창 -> 입력하고 해당 repo 확인

 

 

'기타' 카테고리의 다른 글

[git] branch와 merge  (0) 2021.06.09
[git] .gitignore와 git clone  (0) 2021.06.09
JSON이란?  (0) 2021.06.02
REST API란?  (0) 2021.06.02
서버와 클라이언트, HTTP  (0) 2021.06.02
Comments