Data/Text/Knowledge Analysis & Mining/Python

[Git] 기본 설정 및 사용

manager@ 2013. 7. 30. 14:44


git repository 다운로드 받기 - 방법 1 

$ git clone  https://github.com/user/aaa.git

$ git remote -v


git repository 다운로드 받기 - 방법 2

$ mkdir aaa

$ cd aaa

$ git init

$ git remote add origin https://github.com/user/aaa.git

$ git pull origin

$ git remote -v



기본 환경 설정하기


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


# git commit 시의 editor를 뭘로 할지 설정

$ git config --global core.editor vi



git commit 시에 add에서 제외할 파일 확장자 지정하기

git config --global core.excludesfile ~/.gitignore_global



~/.gitignore_global 을 편집하여 아래와 같은 확장자들을 지정할 수 있다.
#Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db


git 소스 파일 추가 & Commit & Push 


$ vi xxx

$ git add xxx

$ git commit -a

vi로 commit log 편집후에 


$ git push origin master




http://git-scm.com/book/en/Customizing-Git-Git-Configuration