본문 바로가기

TroubleShooting/Etc

git local 저장 간편 사용법

728x90

git local 저장 간편 사용법

$ mkdir sample

$ cd sample

=> sample 디렉토리 생성

$ git init

=> 저장소 생성

$ touch readme

$ cat "this is first." > readme

=> 파일 내용 추가

$ git config --global user.email some@email.com

$ git config --global user.name jj

=> git 환경 설정

$ git add readme

=> index 추가

$ git commit -m "added text file"

=> 작업 내용 확정

$ cat "this is two." >> readme

=> 파일 내용 변경

$ git diff

diff --git a/readme b/readme

index 4bdeb67..2c547bf 100644

--- a/readme

+++ b/readme

@@ -1 +1,2 @@

 this is first.

+this is two.

$ git add readme

=> git index 추가

$ git commit

=> 작업 내용 확정

$ git log

commit ef4a66dd46ef2cd1baa5dfc6dedac7a0a869c6d2

Author: jj <some@email.com>

Date:   Wed Mar 13 17:00:10 2013 +0900


    readme file add content.


commit 053a23fb2fde4d58858c730c62c14b44728abac0

Author: jj <some@email.com>

Date:   Wed Mar 13 16:55:40 2013 +0900


    add readme file


도움받은 사이트

http://rogerdudler.github.com/git-guide/index.ko.html