본문 바로가기
반응형

개발 환경세팅/Git, Github14

[Github] master, main branch 병합하는 방법 (master -> main, main -> master) master, main 브랜치 병합하는 방법 (master -> main, main -> master)1. "There isn't anything to compare. Nothing to compare, branches are entirely different commit histories"에러 발생시2. 프로젝트에서 branch가 master, main 분리되어있을 때 병합하는 방법 예 1: master -> main으로 병합하는 방법1. 병합을 원하는 프로젝트에서 아래 명령어를 실행한다.git checkout mastergit branch main master -fgit checkout maingit push [ssh-연결된 이름 or origin] main -f - master에 있는 걸 main에.. 2023. 6. 18.
[GitHub] branch 기본 명령어 branch 기본 명령어 정리1. 브랜치 확인$ git branch2. 브랜치 생성 명령어$ git branch [branch 이름]3. 브랜치 전환 명령어$ git checkout [branch 이름]4. 브랜치 병합 명령어$ git merge 5. 브랜치 삭제 명령어$ git branch -d [branch 이름]6. 브랜치 이름 바꾸기 (main branch가 변경된다)$ git branch -m [새로운 branch 이름] 2023. 2. 27.
[Github] 원격 저장소 ssh 연결 및 설정(git remote, git config) 깃허브 ssh 관련 연결, 해제, 연결 후 설정( git remote, git config) 명령어1. Repository 원격 연결 확인$ git remote -v2. Repository 연결 $ git remote add origin '[클론 주소]'  * 깃허브 우측 상단 Code를 누른 이후 나오는 주소를 복사하고 붙여넣으면 된다.3. Repository 연결 해제$ git remote remove origin4. 특정 이름으로 연결 및 해제$ git remote '( add or remove )' '( origin or 하고싶은 이름)'  이름, 주소 연결 하는 방법(전역 설정)repository와 ssh 연결이 되어있어야 함(위 Repository 연결) 5. config 명령어로 user의.. 2023. 2. 4.
[Github] 깃허브 프로젝트 연결(Clone 명령어) 깃허브와 프로젝트(로컬 or 서버) 연결하는 방법 (로컬 -> Github, Github -> 로컬), [Git] ! [rejected] master -> master (non-fast-forward) 해결 방법Github와 프로젝트 폴더 연결 ( 프로젝트 폴더(로컬) Github )1. Github에 프로젝트 repository를 먼저 추가한다.2. 로컬이나 서버에 생성하고 싶은 위치에$ git clone '[클론 주소]'   * 깃허브 우측 상단 Code를 누른 이후 나오는 주소를 복사하고 붙여넣으면 된다.  Github와 프로젝트 폴더 연결 ( 프로젝트 폴더(로컬) -> Github )기존에 있는 프로젝트를 연결하는 방법  (프로젝트 폴더 -> Github )1. git 초기화$ git init .. 2023. 2. 4.
반응형