기본 콘텐츠로 건너뛰기

라벨이 git인 게시물 표시

[git] 다른 브런치에서 2명 이상에서 작업하기

이번에는 2대의 환경에서 각각이 다른 브랜치로 작업을 한 경우를 테스트를 해보겠다. 브런치 하나에서 하는거랑 2개에서 하는거랑 별 다를게 없다 ㅋㅋㅋ 이건 그냥 로컬로 브런치를 따서 테스트를... ㅋㅋㅋㅋ (원격에 있는 깃 서버에서도 똑같은 방식으로 진행을 하면된다.) 일단 branch를 test1, test2로 추가적으로 만들어보자. $ git branch test1 $ git branch test2 브런치를 생성을해준다.  브런치를 생성을 하면 해당 브런치를 생성을 시킨 브런치의 코드를 그대로 복사가 된다. checkout을 통해서 브런치를 바꿔가며 코드를 수정을 해보겠다. 우선 master는 그대로 두자 branch name : test1 1 2 3 4 5 6 7 8 9 10 11 ## 유전알고리즘 ### 프로그램 실행 ```py python g.py ``` ### class12345677 test123 window branch test11 cs branch name : test2 1 2 3 4 5 6 7 8 9 10 11 ## 유전알고리즘 ### 프로그램 실행 ```py python g.py ``` ### class12345677 test123 window branch test22 cs C:\Users\mung\Desktop\etc\study\python-gene>git checkout test1 Switched to branch 'test1' C:\Users\mung\Desktop\etc\study\python-gene>git add -A C:\Users\mung\Desktop\etc\study\python-gene>git commit

[git] pull을 하여 최신코드를 내려받자

보면 먼가 로고가 다르게 뜨는것을 확인을 할 수가있다. C:\Users\mung\Desktop\etc\study\python-gene>git checkout remotes/origin/master Note: checking out 'remotes/origin/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:   git checkout -b HEAD is now at 29e282a... fetch test C:\Users\mung\Desktop\etc\study\python-gene>git branch * (HEAD detached at origin/master)   master   test1   test2 깃이 잘 쓰면 참 좋은놈인데 어지간히 쓰기가 까다롭다. 처음에 깃을 푸시 성공하는데만 한달정도 걸렸던걸로 기억이 난다.. ㅋㅋㅋ 여담으로  깃 프로필을 가면 아래사진 처럼 보인다. 기여도에 따라서 초록색으로 작은 박스가 채워지는데 저걸 잔디라고 표현을 한다고 합니다 ㅎ 저 사진은 제 깃 기여도 사진입니당 ㅋㅋㅋㅋ 다시 본론으로 돌아와서 ㅋㅋ pull을 하면 깃에 최신 소