티스토리 뷰
INTRO
git fetch와 pull 차이
1. git fetch : 별도 병합(merge) 필요
git:([branch])$ git fetch origin
원격저장소 commit 파일을 로컬저장소로 가져온다.
원격저장소와 로컬저장소의 변경된 내용을 확인할 수 있다.(origin/[branch], branch는 master, main, ...)
git:([branch]$ git log --decorate --all --oneline
변경된 내용 확인 후 merge하면 git pull과 동일해진다.
git:([branch])$ git merge origin/[branch]
2. git pull : git fetch와 git mergy를 실행한 것과 동일
git:([branch])$ git pull origin [branch]
원격저장소 commit 파일을 로컬저장소로 모두 가져온다.
원격저장소 commit 파일이 update된 내용이고 로컬저장소 파일이 최신 버전이 아닐 때(물론 비어있을 때도..) 사용한다.
원격저장소와 로컬저장소의 변경된 내용을 확인할 수 없다.
git pull 실행하기
git:(main)$ git pull origin main
remote: Enumerating objects: 192, done.
remote: Counting objects: 100% (192/192), done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 192 (delta 26), reused 181 (delta 18), pack-reused 0
오브젝트를 받는 중: 100% (192/192), 539.02 KiB | 475.00 KiB/s, 완료.
델타를 알아내는 중: 100% (26/26), 완료.
https://github.com/jinozpersona/jinozpersona.github.io URL에서
* branch main -> FETCH_HEAD
* [새로운 브랜치] main -> origin/main
error: 병합 때문에 추적하지 않는 다음 작업 폴더의 파일을 덮어씁니다:
.editorconfig
.gitattributes
.github/workflows/pages-deploy.yml
.gitignore
.nojekyll
병합하기 전에 이 파일을 옮기거나 제거하십시오.
중지함
# 참고 : error 발생 시 위에 지정된 파일을 백업하거나 지우고 pull 재실행
git:(main)$ git pull origin main
https://github.com/jinozpersona/jinozpersona.github.io URL에서
* branch main -> FETCH_HEAD
'GitHub' 카테고리의 다른 글
(macOS) github.io chirpy-theme 적용 및 git push (0) | 2022.01.25 |
---|---|
(macOS) github.io jekyll bundler 설치 및 git push 적용 (0) | 2022.01.25 |
(macOS) github.io 블로그 생성 (0) | 2022.01.24 |
(macOS) GitHub 가입 및 git commit/push (0) | 2022.01.24 |
- Total
- Today
- Yesterday
- pyserial
- 라즈베리파이
- server
- 코로나19
- CSV
- COVID-19
- Raspberry Pi
- sublime text
- DAQ
- 코로나
- r
- 자가격리
- git
- DS18B20
- arduino
- ERP
- MacOS
- raspberrypi
- Python
- github
- Model
- Templates
- template
- Regression
- SSH
- analysis
- vscode
- Pandas
- Django
- 확진
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |