2011-04-27

초간단 Git 사용법

요즘 분산 SCM 많이 사용하고 있죠. 가장 많이 이용되는 것으로는 Git, Mercurial, Bazazr 등이 있지요~ 이중에서 우리는 Git 사용법을 아주 간단하게 알아보겠습니다.


  • Install
    • 래드햇 계열 (CentOS)
      # yum install git
    • 데비안 계열 (Debian, Ubuntu)
      # apt-get install git
  • Setup
    # git config --global user.name "Your Name"
    # git config --global user.email youremail@example.com
    # git config --global alias.co checkout
    # git config --global alias.st status
    홈디렉토리에 .gitconfig 에 생성된 것 확인
    [user]
        name = Your Name
        email = youremail@example.com
    [alias]
        co = checkout
        st = status
  • Create Repository
    # cd 프로젝트디렉토리
    # git init
    Initialized empty Git repository in /Users/mhartl/rails_projects/first_app/.git/
  • .gitignore 작성
    web/logs
    web/tmp
    web/server.pid
    *.swp
    *~
    .DS_Store
  • Add and Commit
    # git add .
    # git commit -m "Initial commit"
  • 상태 및 로그 확인
    # git status or git st
    # git log

댓글 없음:

댓글 쓰기