https://guides.github.com/introduction/git-handbook/
git checkout -b developer 라는 branch 를 추가시키면서 동시에 선택한다
= git branch developer + git checkout developer
git clone https://suholee@~.git # change into the `repo` directorycd repo # create a new branch to store any new changes git branch my-branch # switch to that branch (line of development) git checkout my-branch # make changes, for example, edit `file1.md` and `file2.md` using the text editor# stage the changed files git add file1.md file2.md # take a snapshot of the staging area (anything that's been added) git commit -m "my snapshot"# push changes to github git push --set-upstream origin my-branch
서로 다른파일을 수정했을시 브런치들끼리 충돌이 일어나지 않는데
같은 파일을 수정후 할 시 3-way Merge 가 실패함
git status 라는 명령어로 상태확인
충돌 일어난 파일은 unmerged 상태로 됨
<<<<<<< HEAD
>>>>>>> developer
로 표시
위던 아래던 지운다음 새로 작성하여 merge
현재 로컬 브랜치 리스트 보여주는 코드 git branch
현재 서버 브랜치 리스트 보여주는 코드 git branch -a
로컬 브랜치 삭제 git branch -d branchname
커밋상태가 되있는 브랜치 강제삭제 git branch -D branchname
git checkout -t origin/branchname in server 서버에 올라가있는 브랜치 저장소 가져옴
git checkout 커밋 명칭 서버에 올라가있는 커밋저장소 가져옴
git checkout -b [생성할 branch 이름] [원격저장소의 branch 이름] branch 의 이름을 변경하여 가져오고싶을경우
git checkout -t origin/test 원격 저장소의 branch 를 가져오고 싶은경우 ( 위의 방법이 귀찮아서 로컬과 원격저장소의 이름을 같에 하고싶으니까 -t 태그를 사용한 것)
원격 브랜치 업데이트 git remote update