본문 바로가기

GIT4

[Git] Pull 에러 해결하기 "Please commit your changes or stash them before you merge." git pull 을 했더니 다음과 같은 에러가 나왔다. error: Your local changes to the following files would be overwritten by merge: apps/home/insert.py Please commit your changes or stash them before you merge. Aborting - 원인문제의 원인은 원격 저장소에서 pull 할때 로컬에 수정한 파일이 존재하기 때문이다.예를 들어 팀 프로젝트 파일을 pull 하는 것을 까먹고, 로컬에서 프로젝트 파일을 수정하던 중 원격 저장소 파일을 pull  하게 되면 이런 에러가 나타난다. - 해결방법1. 로컬 내 수정 사항을 임시 공간으로 옮긴다git stash 2. 원격 저장소를 pull .. 2024. 7. 24.
[Git] git branch --set-upstream-to 에러 $ git pull을 했더니 There is no tracking information for the current branch.Please specify which branch you want to merge with.See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ main이런 에러가 나왔다. 로컬에 있는 브랜치가 원격저장소의 어떤 브랜치를 참조할지 몰라서 나오는 에러이다  $ git branch --set-upstream-to=origin/main main브랜치를 설정해.. 2024. 7. 10.
fatal: not a git repository (or any of the parent directories): .git git add . 를 했을때 fatal: not a git repository (or any of the parent directories): .git 이런 에러가 나와 git에 추가가 안된다 원인은 현재 폴더에 git에 대한 정보를 담은 파일이 없기 때문에 발생하는 에러이다. 해결방법 git init git remote add origin (github 아이디) 2024. 1. 4.
git 기본 명령어 정리 내가 쓰려고 내가 정리한 git 명령어 - git init : git 생성하기- git clone {path} : 로컬로 소스 코드 가져오기- git commit -m "~" : 커밋 생성- git add . : 변경된 사항 전부 추가하기- git push : 커밋을 원격 저장소에 업로드- git pull : 원격 저장소의 변경 내용을 현재 디렉토리에 가져와서(fetch) 병합함.(merge)- git status : 파일 상태 확인 - sudo : 관리자 권한   자주 사용하는 명령어만 간단히 정리 봤는데 이것만 알아도 git을 기본적으로 사용할 수 있습니다 ! 2021. 2. 26.