티스토리 뷰

Dev/Git/SVN

Git - Setup

jami 2013. 2. 22. 08:27

버전관리 되지 않던 로컬 특정 디렉토리를 Git으로 관리해 보려고 아래와 같이 했다. (원격 연결하지 않음)

1. 설치.

Git : http://msysgit.github.com/

TortoiseGit : http://code.google.com/p/tortoisegit/


2. 사용자 설정

    git config --global user.name "John Doe"
    git config --global user.email johndoe@example.com

--global 옵션 없이 각 프로젝트 마다 다른 사용자 설정할 수 있음.


3. 원격저장소 생성 및 init

    mkdir testRepo
    cd testRepo
    git init --bare


4. 저장소 복제

    git clone /로컬/저장소/경로

탐색기에서.. 마우스 R버튼 > TortoiseGit > clone... 메뉴 이용.

화면에서 URL 대신 "Dir..." 콤보박스를 이용해서 위에서 생성한 저장소를 선택.

"OK" 클릭 시 원격저장소가 원하는 위치(그림에서 Directory 입력항목)에 복제된다.

이후, 복제된 디렉토리에서 작업하면 됨.


5. 커밋

    git add *
    git commit "init"
    git push origin master

  • git add * : 모든 신규/변경 파일을 등록한다.
  • git commit : 파일을 커밋한다. 이 커밋은 원격저장소가 아닌 복제된 저장소에만 커밋이 일어난다.
  • git push origin master : 실제 원격저장소에 반영한다.


오류들..

push 관련 오류

.git 디렉토리의 <config> 파일을 열어 repository 경로를 확인. console 과 GUI툴을 이용 시 경로가 달라질 수 있다.



참고 사이트

Git User Manual : http://www.kernel.org/pub/software/scm/git/docs/user-manual.html

Git-Book(ko) : http://git-scm.com/book/ko, http://dogfeet.github.com/articles/2012/progit.html

TortoiseGit : http://code.google.com/p/tortoisegit/

Git 간편 안내서 : http://rogerdudler.github.com/git-guide/index.ko.html

Git 사용 가이드 : http://www.slideshare.net/dhrim/git-12030742

Git vs SVN 명령어 : http://git.or.cz/course/svn.html



'Dev > Git/SVN' 카테고리의 다른 글

Git - SVN to Git  (0) 2013.02.27
댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함