Git 설정 & 프로젝트 관리 시작하기


Tip: CLI vs GUI?

  • CLI: Command line interface
  • GUI: Graphic user interface with SourceTree

Git 최초 설정

  • 내 깃 정보를 특정하기. github account 는 별개.
    1
    2
    
    git config --global user.name "your name"
    git config --global user.email "your email"
    
  • 확인하기 위해서는 개인 정보 빼고 치기.
    1
    2
    
    git config --global user.name
    git config --global user.email
    
  • 기본 브랜치명 정하기.
    1
    
    git config --global init.defaultBranch main
    

프로젝트 생성! (CLI 버전)

  • Codes/git_practice 폴더 만들어서 여기 git 프로젝트를 생성해보자.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    # git initialization: .git folder 생성
    git init
    # Do you want to change the initial branch to 'main'?
    git branch -m main
    # Code (lions.yaml, tigers.yaml) 생성/변경 한 다음에,
    git status
    # 출력:
      On branch main
    
      No commits yet
    
      Untracked files:
        (use "git add <file>..." to include in what will be committed)
              iterm_theme/
              lions.yaml
              tigers.yaml
    	
      nothing added to commit but untracked files present \
      (use "git add" to track)
    
  • 예시 코드:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#tigers.yaml
team: Tigers
manager: John
members:
- Linda
- William
- David

#lions.yaml
team: Lions
manager: Mary
members:
- Thomas
- Karen
- Margaret

GUI 버전으로 보기

  • Codes/git_practice 폴더를 SourceTree로 끌어서 구경하기.

  • SourceTree의 repository 삭제할 때는, 꼭 북마크 지우기를 선택하자. (조심조심…)

Reference

Notes Mentioning This Note

Table of Contents


Share on: