Sub Tools/GitHub

git 사용방법

큰덩어리 2023. 2. 3. 18:53
728x90
//git 설치 (https://git-scm.com/)

//환경설정 (gitbash - 이름설정 - 이메일설정 -정보확인)
git config --global user.name "홍길동"
git config --global user.email "홍길동@email.com"
git config --list

//git - proj 연결
git init
git add .
git commit -m "프로젝트 설명"
git remote add origin https:"깃 레퍼지토리 주소"
git remote -v

//git 원격 master push
git push origin master

//git 추가내용 업데이트
git add.
git commit -m "프로젝트 설명"
git push origin master

//git 받기
git clone https:"깃 레퍼지토리 주소"

//git branch 만들기
git checkout -b 브렌치

//git 로컬 branch 이동
git checkout 브렌치이름

//git 원격 branch push
git add .
git commit -m "프로젝트 설명"
git push origin 브렌치이름

//git branch 목록
git branch -a

//로컬 branch 삭제
git branch -d 브랜치이름

//원격 branch 삭제
git push origin --delete 브랜치명

//원격 서버의 branch를 불러와 local에서의 원격 branch 와 동기화 한다
git fetch -p origin
728x90