개발자 유자❤

IT/GIT

[GIT] 23강 GIT remote branch

💡GIT remote branch git clone => git init, git remote, git fetch 모두 해결! git fetch => 로컬 저장소로 가져오는 것이 아니라 remote branch에 가져오는 것. => 따라서 별도의 branch 생성과 체크아웃, merge 필요함. git checkout -b ~ origin/~ => branch생성, 체크아웃, merge 모두 해결! git pull => git fetch , merge 해결! => 이미 branch 존재하는 로컬파일에 원격지에서 추가 수정사항 반영할 경우

IT/GIT

[GIT] 22강 GITHUB 기초2

git push origin topic : github에 topic이라는 branch가 없으면 생성해주고 push해준다. 💡 git hub에 branch 여러 개 존재하는 경우 해당 branch가 없는 로컬에서 다운로드 방법! 👉 방법1 1. git fetch origin => 전체 동기화시켜줌 => 모든 브랜치 다운로드 2. git checkout -b topic origin/topic => origin 안에 topic을 topic이라는 이름으로 가져온다. => 브랜치 생성 및 머지 👉 방법2 1. git checkout -b topic (브랜치 생성) 2. git pull origin topic (topic 브랜치 다운로드 및 머지) ● master가 아닌 다른 branch에서 작업을 완료하고 mas..

IT/GIT

[GIT] 18강 git rebase

💡 rebase : 코드에 대한 로그를 깔끔하게 정리 💡 squash : 압축하다 (항상 과거로 압축해야 함) 💡 시나리오 1. git init 2. touch 환경설정.txt 3. git add . 4. git commit -m "환경설정" 5. touch 로그인퇴근.txt 6. git add. 7. git commit -m "로그인퇴근" 8. touch 로그인아파서퇴근.txt 9. git add. 10. git commit -m "로그인아파서퇴근" 11. touch 로그인완료.txt 12. git add . 13. git commit -m "로그인완료" 14. git rebase -i HEAD~3 vi editor 열림! -> i누르면 insert 모드로 변경! -> 밑에 옵션 설명 중 로그인아파서퇴..

IT/GIT

[GIT] 17강 GIT MERGE 충돌

💡 git merge 충돌 시나리오 1. git init 2. touch 로그인.txt => 내용 : 로그인 3. git add . 4. git commit -m "로그인" 5. git checkout -b topic 6. git branch 7. 로그인.txt => 내용 : 로그인2로 수정 8. git add . 9. git commit -m "로그인2" 10. git checkout master 11. 로그인.txt => 내용 : 로그인1로 수정 12. git add . 13. git commit -m "로그인1" 14. git merge topic => conflict 발생 로그인.txt파일 열어보면 아래와 같이 master branch 에서 수정한 결과와 topic branch에서 수정한 결과 동..

IT/GIT

[GIT] 16강 3-WAY MERGE 실습

💡 3-way merge 실습 1. git init 2. touch 회원가입.txt 3. git add . 4. git commit -m "회원가입" 5. touch 로그인.txt 6. git add . 7. git commit -m "로그인" 8. git checkout -b topic => git branch topic + git checkout topic 같은 의미! => -b 가 branch를 만들면서 checkout까지 해라 라는 의미! 9. touch 아이디중복체크.txt 10. git add . 11. git commit -m "아이디중복체크" 12. git checkout master 13. touch 글쓰기.txt 14. git add . 15. git commit -m "글쓰기" mas..

IT/GIT

[GIT] 15강 fast-forward merge 실습

💡 fast-forward merge 실습 1. git init 2. touch 회원가입.txt => 해당 폴더에 회원가입.txt 파일 생성 3. git add . 4. git commit -m "회원가입" 5. touch 로그인.txt 6. git add . 7. git commit -m "로그인" 8. git branch => 현재 master를 branch pointer가 가리킨다는 것을 알 수 있음 9. git branch topic => topic이라는 branch 생성 10. git branch 하면 topic 생성된거 확인 가능 11. git log => master, topic 모두 로그인 가리키고 있는걸 알 수 있음. => HEAD는 master 가리키고 있음. 현재 여기서 작업 중임! ..

IT/GIT

[GIT] 14강 GIT fast-forwad merge 이해

브랜치 포인터 개념을 통한 💡 fast - forward merge commit하면 barnch point가 이동! merge할 때 main branch point가 앞으로 이동하면서 topic branch point와 가리키는 곳이 일치하게 됨!!! => Fast-Forward Merge

IT/GIT

[GIT] 13강 GIT Branch 1차 기본개념

💡 3 - way merge : 형상이 다를 때 로그인을 기점으로 idea branch 생성되고 따라서 로그인은 공통 조상! idea brach를 main branch랑 합치는걸 merge! fast - forward merge : 형상이 같을 때 : 현재 브랜치의 HEAD가 대상 브랜치의 HEAD까지로 옮기는 merge

IT/GIT

[GIT] 12강 git amend

💡 Git amend : 마지막 커밋 변경 git branch에 1개밖에 없을 때는 reset 사용 x => 이름 변경 원할 시 git commit --amend -m "변경할 이름" 단 git commit --amend 직전 커밋 메시지만 수정 가능! => branch에 1개만 존재하는 것이 아니라면 git reset --soft 하고 git commit -m 다시 해줘도 됨!

IT/GIT

[GIT] 11강 git reflog

💡 Git reflog git reflog => 한번이라도 commit 했으면 내용 다 남아있음! 여기서 노란색 해쉬값을 통해 git reset --hard 46d9 이런식의 명령어를 통해 그때의 상태로 돌아갈 수 있음!

유자나라
'Git' 태그의 글 목록