본문 바로가기

Python_Beginer/GIT

(38)
[GIT]Tracked File / Untracked File(추적상태 / 비추적상태) $ vim hello.txt $ vim hello2.txt $ git status $ git add hello.txt $ git add hello2.txt $ git commit -m "message3" $ git log $ git log --stat 1. Tracked : 한 번이라도 커밋을 한 파일의 수정 여부를 계속 추적하는 상태 Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: hello.txt 2. Untracked : 한 번도 깃에서 버전 관리를 하지 않았기 때문에..
[GIT]Git Diff(변경 사항 확인) 1. Git Diff : 작업트리에 있는 파일과 스테이지에 있는 파일을 비교 스테이지에 있는 파일과 저장소에 있는 최신 커밋을 비교해서 수정한 파일을 커밋하기 전에 검토 2. $ vim hello.txt $ git status $ git diff warning: LF will be replaced by CRLF in hello.txt. The file will have its original line endings in your working directory diff --git a/hello.txt b/hello.txt index 1191247..0b66db0 100644 --- a/hello.txt +++ b/hello.txt @@ -1,2 +1,2 @@ 1 -2 +two 3. 최신버전과 비교하여 달..
[GIT]Git Log(커밋 기록 확인) 1. Git Log : 커밋했던 기록 확인 $ git log commit 040d13b110d44c9d48fac14b0948225248f7a348 (HEAD -> master) Author: AnKiWoong Date: Thu Jan 2 20:43:17 2020 +0900 message2 commit 0f4285bedfbf470de8f325c6763e3a76713c4aa7 Author: AnKiWoong Date: Thu Jan 2 20:35:37 2020 +0900 message1 2. Git Hash / Commit Hash : 커밋을 구별하는 아이디 commit 040d13b110d44c9d48fac14b0948225248f7a348 3. 버전 확인 : (HEAD -> master) 라고 적혀있으면..
[GIT]Staging + Commit(스테이징 + 커밋) 1. 문서 수정 $ vim hello.txt 1 2 2. 깃 상태 확인 $ git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: hello.txt no changes added to commit (use "git add" and/or "git commit -a") 3. 스테이징과 커밋 처리 : 한번 커밋한 파일이라면 가능 $ git commit -am "message2" warning: LF will be replaced by C..
[GIT]Repository(저장소) 1. 저장소(Repository) : 스테이지에서 대기하고 있던 파일들을 버전으로 만들어 저장하는 곳 2. 커밋(Commit) : 버전을 만드는 것 3. git commit -m "메시지" $ git commit -m "message1" [master (root-commit) 0f4285b] message1 1 file changed, 1 insertion(+) create mode 100644 hello.txt 4. 깃 상태 확인 $ git status On branch master nothing to commit, working tree clean 5. 저장된 버전 확인 $ git log commit 0f4285bedfbf470de8f325c6763e3a76713c4aa7 (HEAD -> master..
[GIT]Stage(스테이지) 1. 스테이지(Stage) : 버전으로 만들 파일이 대기하는 곳 2. 스테이징(staging) : 버전 만들 준비 3. git add 파일명 : 스테이징 $ git add hello.txt warning: LF will be replaced by CRLF in hello.txt. The file will have its original line endings in your working directory (깃에서 자동으로 텍스트 문서의 CRLF 문자를 LF 문자로 변환해서 커밋) 4. 깃 상태 확인 $ git status On branch master No commits yet Changes to be committed: (use "git rm --cached ..." to unstage) new fil..
[GIT]Working Tree(작업 트리) 1. 작업 트리(Working Tree) : 파일 수정, 저장 등의 작업을 하는 디렉터리 2. 깃 상태 확인 $ git status On branch master No commits yet nothing to commit (create/copy files and use "git add" to track) 3. 문서 생성 $ vim hello.txt 1 4. 문서 읽기 $ cat hello.txt 1 5. 깃 상태 재확인 $ git status On branch master No commits yet Untracked files: (use "git add ..." to include in what will be committed) hello.txt nothing added to commit but untr..
[GIT]Git Initialization(깃 초기화) 1. git init : 깃을 사용할수 있도록 디렉터리를 초기화(저장소(repository)) $ pwd $ cd documents $ mkdir git $ cd git $ mdkir hello-git $ cd hello-git $ ls -la $ git init . $ ls -la $ cd .git $ ls -la $ cd .. 2. .git : 숨김폴더 속성을 지니고 있음 / 보기 > 숨김 항목 체크