git 기본 명령어

2020. 8. 3. 09:44카테고리 없음

https://sjh836.tistory.com/31 

 

GIT의 기본 명령어

1. Git같은 버전관리시스템이 나오게 된 배경 - 파일이나 폴더를 편집할 때 작업을하면서 아래 사진처럼 번잡하게한다. - 만약 여러명이 공유한 파일을 편집한다면 저장할때 동기화문제가 있다.

sjh836.tistory.com

 

의미

 

git commit : local repository 에 저장하는 것을 의미 

 

git push :  Remote repository에 저장은 push라는 동작으로 이루어 진다. 

 

 

-- 새 브랜치 따는법 (새로운 브랜치 feature/instagram을 develop 브랜치에서 분기 )

git checkout -b feature/instagram develop

더보기

출처: https://gmlwjd9405.github.io/2018/05/11/types-of-git-branch.html

// 새로운 branch 생성후 들어가기 

git checkout -b new-branch-name

 

//git branch 했을떄, * new-branch-name 상태에서

// develop branch 의 내용 가져오기 

git pull origin develop 

 

// branch 삭제 

git branch -d new-branch-name

// feature/instagram을 remote repositary에 배포

git push origin feature/instagram

 

git checkout 또는 git pull 에러시 

Please commit your changes or stash them before you merge. 

git stash: 내가 수정한 소스를 저장하고 이전 커밋 시점으로 되돌린다.

git stash 

https://right-hot.tistory.com/entry/%EA%B9%83%ED%97%88%EB%B8%8C-pull-%EC%B6%A9%EB%8F%8C-%EC%97%90%EB%9F%AC-Please-commit-your-changes-or-stash-them-before-you-merge  

 

[ 깃허브 ] pull 충돌 에러 : Please commit your changes or stash them before you merge.

깃허브 pull 충돌 에러 Please commit your changes or stash them before you merge. git pull [ 레파짓 주소 ] git stash 내가 수정한 소스를 저장하고 이전 커밋 시점으로 되돌린다. git pull [ 레파짓 주소 ]..

right-hot.tistory.com

remote 서버의 branch에 있는 것을 가져온다. 

git pull <remote> <branch>

 

branch 삭제 하는법 

git branch -d Old_branch_name

 

삭제한 뒤 remote에 반영하기(push 해주되 : 을 붙여줘야 한다.)

git push origin :Old_branch_name