How to deploy git
by RileyKim
깃 브런치 생성 및 배포
프로젝트를 진행하며, 협업을 하신다면 깃 브런치 생성과 배포는 필수적으로 알아야합니다.
나의 작업물과 협업자의 작업물을 분리하여 작업할 수 있기때문에 소스 관리에 굉장히 효율적입니다.
하나의 프로젝트가 있다고 칩시다.
그 프로젝트의 뿌리는 master라고 칭하고, branch를 생성하여 여러갈래의 작업자로 나눕니다.
각 작업자들이 완료한 작업들을 push하고 master에서 병합합니다. :)
브런치 생성 명령어
Make Branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch <branchName> |
만약 ‘taeksu’라는 branch를 만들고 싶다면 git branch taeksu
를 입력하면 됩니다 ㅎ
브런치 목록 확인
check branch list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch |
.git이 있는 경로로 가서 실행해야합니다.
지금 저의 branch는 ba인 것을 확인할 수 있습니다.
브런치 변경
change branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout <BranchName> |
master Branch를 사용하고 싶다면,
master Branch로 변경된 것을 확인할 수 있습니다.
브런치 커밋 & 푸쉬
ba라는 작업자(Branch)가 작업을 완료한 후 커밋 & 푸쉬를 진행해보도록 하겠습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git add --all // 완료된 모든 작업을 add합니다 | |
git commit -m "add내용" // commit과 다른 작업자가 무엇을 commit하는 지 알 수 있게 메시지를 추가합니다. | |
git push -u origin ba // ba라는 작업자가 완료된 작업을 푸쉬하여 master에게 merge를 요청합니다. |
만약 master branch가 아니라면 , git repository에 접속해서 master 계정으로 merge를 진행하면 됩니다!
또 하나의 팁은 push하기 전 pull를 통해 수정사항을 업데이트하는 습관을 기릅시다!
Subscribe via RSS