원격 저장소에 푸시하기

Git 중급

George Boorman

Curriculum Manager, DataCamp

원격 저장소에서 풀하기

원격 저장소에서 풀

Git 중급

원격 저장소에 푸시하기

원격 저장소에 푸시

Git 중급

git push

  • 먼저 로컬에 변경 사항 저장!
git push remote local_branch
  • local_branch에서 remote_로_ 푸시

  • 로컬 저장소의 main 브랜치에서 origin으로 변경 사항 푸시

git push origin main
Git 중급

Push/Pull 워크플로

원격에서 로컬 저장소로 풀

Git 중급

Push/Pull 워크플로

로컬에서 프로젝트 작업

Git 중급

Push/Pull 워크플로

업데이트된 로컬 저장소를 원격에 푸시

Git 중급

먼저 푸시하기

  • 풀 전에 main을 원격에 푸시
git push origin main
Git 중급

원격/로컬 충돌

git push origin main 거부 출력

Git 중급

원격/로컬 충돌

git push origin main 거부 출력 - 원격 URL 주석

Git 중급

원격/로컬 충돌

git push origin main 거부 출력 - 결과 주석

Git 중급

원격/로컬 충돌

git push origin main 거부 출력 - 원인 및 제안 주석

Git 중급

충돌 방지하기

  • 먼저 원격에서 풀
git pull origin main

git_pull_nano_editor.gif

Git 중급

편집 없이 풀하기

git pull --no-edit origin main
  • 프로젝트 히스토리를 충분히 파악한 경우에만 권장합니다!
Git 중급

새 로컬 브랜치 푸시하기

  • 로컬에서 hotfix 브랜치 작업 중

  • hotfix가 원격에 존재하지 않음

Git 중급

새 원격 브랜치 생성하기

  • hotfix가 로컬에만 존재
git push origin hotfix
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 349 bytes | 349.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: 
remote: Create a pull request for 'hotfix' on GitHub by visiting:
remote:      https://github.com/datacamp/project/pull/new/hotfix
remote: 
To https://github.com/datacamp/project
 * [new branch]      hotfix -> hotfix
branch 'hotfix' set up to track 'origin/hotfix'.
Git 중급

연습해 봅시다!

Git 중급

Preparing Video For Download...