본문 바로가기

Git7

[Git] fatal: refusing to merge unrelated histories remote repository를 변경할 일이 있어서 git bash에 다음 command를 입력하여 remote repository를 변경하였다. git remote set-url origin [new repository] 새로운 repository에 .gitignore 등의 파일이 생겼고, local에서 push하기 전에 pull을 시도했더니 해당 오류가 발생했다. 서로 연결된 적이 없는 두 프로젝트를 merge하려고 하면 git에서 이를 거부하는 것이라고 한다. 때문에 이를 강제로 진행 가능하도록 허가해 주어야 한다. git pull origin main --allow-unrelated-histories --allow-unrelated-histories를 붙여서 pull을 시도하면 해당 오류 없이 .. 2024. 1. 17.
[Git] 특정 브랜치만 clone해 오기 git bash 창에서 $git clone -b {브랜치 이름} --single-branch {원격 repository 주소} 2023. 1. 16.
[Git] 원격 저장소 확인, 삭제, 변경 git remote -v git remote remove origin git remote add origin [원격 저장소 주소] 또는 git remote set-url origin [원격 저장소 주소] 2023. 1. 15.
[Git] git status 분석 기초 *** 공부하면서 알게 된 것들을 메모하는 페이지입니다. 오류가 있을 수 있습니다.*** hello.txt 를 commit 후 수정했고, hello2.txt를 새로 만든 후의 git status 상황이다. changes not staged for commit : 기존 commit 했던 hello.txt 가 수정되었으나 아직 그 변화된 파일이 stage에 올라가지 않았다는 것을 알려줌. modified : 수정된 파일을 알려 줌(여기서는 hello.txt) untracked files : 아직 한 번도 hello.txt를 commit 하지 않았기 때문에 git이 추적하지 않음. 이 상태에서 hello.txt와 hello2.txt를 모두 staging 하면(git add .) tracked file을 수정하.. 2023. 1. 3.