Git 사용법 (JSP 보강)

갓김치·2020년 11월 25일
0

기타

목록 보기
9/16

svn

  1. 팀장이 SVN 서버에 share project
  2. 팀원들이 checkout -> 동기화 진행됨
  3. 작업 후 commit
  4. 동료들은 update

git

  • git을 사용하면 로컬에 나의 저장소가 따로 존재
  • commit, update를 하더라도 로컬에 있는 나의 저장소에 영향을 끼침
  • remote가 아닌 local에서 가져오는 것이다.

순서 (local안에서 이루어지는 작업)

  1. working directory에서 project 작업
  2. add라는 명령어로 staging area로 올리게되면 index를 부여받고, 이 index 기반으로 버전관리 이루어짐
  • staging area : 임시 공간
  • index 부여했다가 index 회수 가능
  1. staging에서 repository 단계로 올리는 것이 commit
  • svn의 commit이 add와 commit으로 쪼개져있음
  1. A가 local에서 remote로 올릴 때 push
  • 1, 2, 3 이라는 히스토리 전부가 remote로 push됨

  1. B가 remote에서 remote resource에 대한 히스토리 정보를 본인의 local로 pull

git 설치

  • notepad++
  • git from the command line and also from 3rd-party software
  • user the native windows secure channel library
  • checkout windows-style, commit unix-style line endings
  • use windows' default console window
  • default로 체크
  • git credential mangaer core로 체크
  • enable file system encoding 체크

cmd

Microsoft Windows [Version 10.0.18363.1198]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\PC-02>git version
git version 2.28.0.windows.1

C:\Users\PC-02>d:

D:\>mkdir gittest

D:\>cd gittest

D:\gittest>git init
Initialized empty Git repository in D:/gittest/.git/

D:\gittest>dir
 D 드라이브의 볼륨에는 이름이 없습니다.
 볼륨 일련 번호: 0EE7-ADA3

 D:\gittest 디렉터리

2020-11-25  오후 06:07    <DIR>          .
2020-11-25  오후 06:07    <DIR>          ..
               0개 파일                   0 바이트
               2개 디렉터리  975,269,703,680 바이트 남음

D:\gittest>dir /a
 D 드라이브의 볼륨에는 이름이 없습니다.
 볼륨 일련 번호: 0EE7-ADA3

 D:\gittest 디렉터리

2020-11-25  오후 06:07    <DIR>          .
2020-11-25  오후 06:07    <DIR>          ..
2020-11-25  오후 06:07    <DIR>          .git <!-- local rp라는 증거 -->
               0개 파일                   0 바이트
               3개 디렉터리  975,269,703,680 바이트 남음

D:\gittest>

D:\gittest>cd .git

D:\gittest\.git>dir
 D 드라이브의 볼륨에는 이름이 없습니다.
 볼륨 일련 번호: 0EE7-ADA3

 D:\gittest\.git 디렉터리

2020-11-25  오후 06:07               130 config
2020-11-25  오후 06:07                73 description
2020-11-25  오후 06:07                23 HEAD
2020-11-25  오후 06:07    <DIR>          hooks
2020-11-25  오후 06:07    <DIR>          info
2020-11-25  오후 06:07    <DIR>          objects
2020-11-25  오후 06:07    <DIR>          refs
               3개 파일                 226 바이트
               4개 디렉터리  975,269,703,680 바이트 남음

D:\gittest\.git>notepad config

D:\gittest\.git>

git status

D:\gittest>git status
On branch master

No commits yet

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

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

D:\gittest>git add *

D:\gittest>git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   file1.txt


D:\gittest>

로그인

git config user.name "닉네임입력"
git config user.email "이메일입력"

이클립스


profile
갈 길이 멀다

0개의 댓글