Skip to content

Instantly share code, notes, and snippets.

@kenu
Last active October 18, 2022 19:27
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save kenu/bfcee2cc672805672b92 to your computer and use it in GitHub Desktop.
Save kenu/bfcee2cc672805672b92 to your computer and use it in GitHub Desktop.
easy git
# 쉬운 버전관리 Git
Part 1 기본
1. Git 이란?
파일의 변경 이력을 관리할 수 있는 버전관리시스템
CVS, SVN과 달리 네트워크가 끊긴 상황에서도 버전 기록(commit) 가능
리누스 토발즈가 개발
GitHub.com 서비스를 통해서 확산
프로젝트별로 관리 가능
GitHub, GitLab, BitBucket, NForge 무료 비밀 저장소 지원
2. 다운로드, 설치
http://git-scm.com 에서 Windows, Linux, MacOSX 다운로드 가능
3. 사용자 설정
코드를 변경한 사람의 이름과 이메일을 등록
git bash 실행
`git config --global user.email "kenu.heo@gmail.com"`
`git config --global user.name "kenu"`
4. Git 시작하기
`git init`
.git 폴더가 생기면서 이하 파일 버전관리 시작
5. 관리 파일 추가하기
`git add filename`
index에 추가. stage에 올라감.
`git add *`
`git add .`
하위 디렉토리 전부 추가
`git status` 명령으로 상태 확인
* Git 파일 상태
* Workspace
* Stage
* Repository
* Remote Repository
6. 버전 등록하기
`git commit -m "메시지"`
7. 변경 이력 보기
`git log`
`git log --oneline`
8. 이전 버전으로 복원하기
`git reset --hard`
`git reset --hard versionhash`
9. 파일 제외하기
.gitignore 파일에 패턴 추가
Part 2 코드 공유
10. GitHub 회원가입
https://github.com
11. GitHub 프로젝트 만들기
new Repository 메뉴 선택
12. 프로젝트 PC로 가져오기
`git clone https://github.com/아이디/프로젝트명.git`
`git clone https://github.com/그룹명/프로젝트명.git`
13. 원격 코드 가져오기
`git pull`
14. 원격에 코드 올리기
`git push`
참고
누구나 쉽게 이해할 수 있는 Git 입문
https://backlog.com/git-tutorial/kr/
Git 브랜치 배우기
https://learngitbranching.js.org/?locale=ko
A successful git branching model
http://dogfeet.github.io/articles/2011/a-successful-git-branching-model.html
@rkJun
Copy link

rkJun commented Aug 18, 2015

21 라인 오타 신고합니다.^^
수정전 : git config --global user.email "kenu"
수정후 : git config --global user.name "kenu"

@kenu
Copy link
Author

kenu commented Aug 25, 2015

@rkJun 땡큐! 고마워요.

@qylee
Copy link

qylee commented Sep 10, 2015

초간단 git 설명서~ 좋아요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment