Git을 설치하기에 앞써 Git이란?
Git이란 souce 관리를 위한 분산 버전 관리 시스템입니다.
최초로 리눅스 토발즈가 리눅스 커널 개발에 이용하려고 개발하였습니다.
코드를 버전 관리함으로써, 배포후 major 버그를 발생시 빠르게 rollback을 하거나 수정된 코드만을 파악하여, 버그를 빠르게 찾거나, 한 프로젝트의 코드를 여러 사람이 함께 작업 할 수 있도록 도와주는 등의 장점때문에 사용합니다.
간단한 Git명령어
- git init : git 생성하기
- git clone git_path : 코드가져오기
- git checkout branch_name : 브랜치 선택하기
- git checkout -t remote_path/branch_name : 원격 브랜치 선택하기
- git branch branch_name : 브랜치 생성하기
- git branch -r : 원격 브랜치 목록보기
- git branch -a : 로컬 브랜치 목록보기
- git branch -m branch_name change_branch_name : 브랜치 이름 바꾸기
- git branch -d branch_name : 브랜치 삭제하기
- git push remote_name — delete branch_name : 원격 브랜치 삭제하기 ( git push origin — delete gh-pages )
- git add file_path : 수정한 코드 선택하기 ( git add * )
- git commit -m “commit_description” : 선택한 코드 설명 적기 ( git commit -m “내용”)
- git push romote_name branch_name : add하고 commit한 코드 git server에 보내기 (git push origin master)
- git pull : git서버에서 최신 코드 받아와 merge 하기
- git fetch : git서버에서 최신 코드 받아오기
- git reset — hard HEAD^ : commit한 이전 코드 취소하기
- git reset — soft HEAD^ : 코드는 살리고 commit만 취소하기
- git reset — merge : merge 취소하기
- git reset — hard HEAD && git pull : git 코드 강제로 모두 받아오기
- git config — global user.name “user_name ” : git 계정Name 변경하기
- git config — global user.email “user_email” : git 계정Mail변경하기
- git stash / git stash save “description” : 작업코드 임시저장하고 브랜치 바꾸기
- git stash pop : 마지막으로 임시저장한 작업코드 가져오기
- git branch — set-upstream-to=remote_path/branch_name : git pull no tracking info 에러해결
본격적으로 Git설치를 시작~
Git - Downloads
Downloads Mac OS X Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific
git-scm.com
먼저 위에 링크에 접속해서 window용 git을 설치하면서
필요한 environment를 확인해주며 next>한다.
설치를 완료하고git을 잘 설치했는지를 확인하기 위해서는
window cmd화면에서
아래 화면을 확인할 수 있다.
만약
git version이
"'git'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다."
라고 출력될경우
환경변수설정을 해야한다.
환경변수 설정은
시스템 환경 변수 편집은 path 편집으로 들어와서
경로를 새로 추가해준다.
주의해야할 점은 C:\Program Files\Git\bin 처럼 bin경로까지 설정해야한다.
환경변수 설정까지 완료하면 아래와 같이 git version이 나오면서
git을 성공적으로 설치한 것을 확인 할 수 있다!
'IT환경설절' 카테고리의 다른 글
Android Studio에서 Nox연동하기 (0) | 2020.07.31 |
---|---|
Github 사용하기(Sourcetree및 관리자 권한 부여방법) (0) | 2020.07.17 |
MariaDB설치 후 한글입력까지 (0) | 2020.07.16 |
Tomcat 설치 (1) | 2020.07.15 |
JDK 설치하기 (2) | 2020.07.15 |
댓글