본문 바로가기

728x90

git

(12)
git 브랜치 생성 및 변경 → git init  (초기화)→ git remote add origin [주소]   (원격 레포지토리 주소 설정)→ (브랜치 리스트가 없는 경우 + 최초) git fetch --all  (원격 저장소의 최신 정보를 가져옴)→ git checkout feature/division→ git clone —branch feature/division [주소]   또는 git fetch origin feature/product_level
Existing because of unfinished merge. 일단 원인은 커밋을 하지 않아서 나타나는 현상이다. 그래서 git status를 확인! All confilicts fixed but you are still merging. 충돌은 수정되었고 여전히 merging하고 있다. -> git push origin main
error: 레퍼런스를 'https://github.com/ohsoomansour/shoppingmall_front.git'에 푸시하는데 실패했습니다 1. git branch 확인*master -> git branch main -> git checkout main 트래킹 설정 2. git branch --set-upstream-to=origin/main main   3. git branch -vv로 확인 로컬 브랜치 main은 origin/main 을 트래킹하고 있다.
.gitignore 파일 env파일 삭제 안되는 경우 1. git rm .env.dev --cached: 해당 파일을 추적에서 제거한다. --cached 옵션은 워킹 디렉토리에 있는 파일은 삭제하지 않고, 인덱스(index)에서만 추적을 제거함으로 로컬 파일은 그대로 유지되며 Git의 추적에서만 제거된다. git commit -m "": 변경 사항을 커밋해 추적에서 제거된 파일들이 Git의 히스토리에서 사라지게 된다. 2. .gitignore 파일 : .env.dev 파일 추가  3. git 추적 중단 되돌리기 git update-index --no-assume-unchanged [파일이름] 그리고 .gitignore 파일에서 .env.dev 삭제
git config pull.rebase false git config pull.rebase false- 리베이스 사용 안 함: 원격 저장소의 변경 사항을 현재 브랜치에 적용할 때 리베이스 대신 병합을 수행합니다. 이는 원격 브랜치의 커밋 히스토리를 그대로 유지하며, 변경 사항을 통합할 때 새로운 병합 커밋이 생성됩니다.- 명령어: git pull 명령을 사용할 때, 자동으로 --no-rebase 옵션이 적용되는 것과 같습니다.pull 할 때 rebase를 하지 않고 merge한다.git config pull.rebase truepull 할 때 rebase를 한다.git config pull.ff onlyfast-foward 일때만 pull을 허용한다.git config pull.rebase false1. git config pull.rebase fals..
본인 브랜치와 리모트 브랜치 merge 1. 브랜치를 변경: sooman -> admin 변경 후 pushl할려고 했더니 error: failed to push some refs to 'https://github.com/gudiedu/gudi_edu_front.git'이유는 pull을 하지 않았기 때문! pull을 할려고 했더니  다른 에러가 발생There  is no tracking information for the current branch  pull을 하기 전  tracking information 을 아래와 같이 set 해줘야한다. git branch --set--upstream-to=origin/admin*upstream이란 ? 현재 작업 중인 브랜치가 어떤 원격 브랜치를 따라가야 하는지를 가리킴 그리고 나서 git pull ori..
git stash 방법
다른 컴퓨터 사용시 local branch가 remote branch를 tracking하지 못할 경우
git reject 문제 이 문제가 발생하는 경우는 나의 local과 remote의 파일 불일치 때문이다. 따라서 git pull [원격 저장소 별칭:origin ] main 는 당겨와서 병합해준다고 생각하면된다. 그리고 git push origin main 마무리 해주면 끝!!
Updates were rejected because the tip of your current branch is behind git Error 발생 hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 해결: git push -u origin +master

728x90