본문 바로가기
반응형

● IDE, System/Git14

[해결방법] error: src refspec master does not match any 상황 : git push origin master 입력하니 error: src refspec master does not match any 발생 원인 : 깃허브에서 pull 없이 push할 경우 기존 내용 삭제 문제가 생길 수 있기 때문. 해결 방법 : git init git add . git commit -m "message" git remote add origin "github.com/your_ropo.git" git push -u origin master 만약 master 브랜치가 없어서 발생하는 오류라면 : git checkout -b 'master' git push origin master 도움이 되셨다면 하단의 ❤하트❤ 클릭해주세요! 감사합니다 😊 2021. 8. 9.
[깃허브 에러] fatal: adding files failed 에러명 : fatal: adding files failed 해결 : git add --ignore-errors . git add --ignore-errors . 2021. 5. 26.
[깃허브 에러] Please move or remove them before you merge. 상황 : git pull 진행시 발생 에러명 : Please move or remove them before you merge. 원인 : 기존 내용과 push할 내용의 충돌 해결방법 : 병합 git add -A git stash git pull 2021. 5. 26.
[Git] Commit, Push 했는데 contribution이 안된다. 깃허브 잔디가 안 심어진다면? 커밋할 폴더로 들어가서 git bash를 실행시킨 뒤 깃허브와 동일한 계정정보로 git config를 재설정해줘야한다. git config --global user.name "myname" git config --global user.email "myemail@gmail.com" 이렇게 해준 뒤, Commit, Push해주면 Git hub contribution, 잔디심기가 진행된다. [Git] 깃허브 시작하기. 총정리 (init, add, commit, push, pull) 1. git bash 실행 후 이름, 이메일 입력 git config --global user.name "myname" git config --global user.email "myemail@gmail.com" 2. 저장소 설정 후.. 2021. 3. 1.
[Git] [rejected] master -> master 오류 해결 에러 발생 : [rejected] master -> master 원인 : Github의 원격 저장소와 로컬 저장소의 내용이 무관하기 때문 해결방법 : $ git pull origin master --allow--unrelated-histories git에서는 서로 관련 기록이 없는 이질적인 두 프로젝트를 병합할 때 기본적으로 거부하는데, 이것을 허용해 주는 코드 Git 설치 및 사용 방법 간단한 Git 설치 및 사용 방법 정리​Git 다운로드아래 링크로 접속하여 Download for Windows 클릭을 ... blog.naver.com 2021. 2. 27.
[Git] fatal: refusing to merge unrelated histories 해결 에러발생 : fatal: refusing to merge unrelated histories 해결 방법 : push 전에 먼저 pull을 해서 프로젝트를 병합해주면 해결 refusing to merge unrelated histories 만약 위 방법이 안된다면 하단 방법으로 진행 git pull origin 브런치명 --allow-unrelated-histories 브런치명이 master라면 하단을 입력 git pull origin master --allow-unrelated-histories 도움 : gdtbgl93.tistory.com/63 2021. 2. 27.
[Git 에러] fatal: couldn't find remote ref master 해결 git pull origin master를 입력했더니 다음과 같은 에러가 발생했다. 에러 : fatal: couldn't find remote ref master 원인 : Github의 기본 생성 브랜치 이름이 입력한 것과 달라서 나타난 것. 다시말해서 $ git pull origin master 에서 master가 아닌 다른 이름을 썼다는 의미다. 본인의 Repository로 가서 확인 후 name을 제대로 쓰면 된다. Branch Name 확인방법 Branch Name을 main이 아닌 master로 바꾸고 싶다면? 브랜치 페이지의 좌측 하단에 있는 펜모양을 클릭 이름을 바꿔주고 초록색의 Rename branch버튼을 눌러주면 끝! 수정 후 메인페이지에 나타난 창 도움이 되셨다면 하단의 ❤하트❤ 클릭.. 2021. 2. 27.
[Git] error: remote origin already exists. 오류 해결 에러 발생 : error: remote origin already exists. 해결 : $ git remote rm origin 참고자료 2021. 2. 27.
git add, git commit 취소하기 git add 취소 git reset (전체 파일 add 취소) git reset HEAD 파일 (특정 파일 add 취소) git commit 취소 git reset HEAD^ (가장 최신 커밋 1개 취소(삭제)) git reset HEAD^^(가장 최신 커밋 2개 취소(삭제)) 꺽쇠 갯수에 따라 최신 커밋을 필요한만큼 순서대로 삭제할 수 있음 $ git reset HEAD^ 입력 시 오류발생 fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree. 2021. 2. 5.
깃허브에 이미지, 링크 넣기 깃허브에 이미지, 링크 넣기 gist.github.com/ninanung/2b81a5db946c26c98c573e3662a92b62 사실은 내가 보기위한 마크다운 문법설명서 - 4. 링크와 이미지넣기 사실은 내가 보기위한 마크다운 문법설명서 - 4. 링크와 이미지넣기. GitHub Gist: instantly share code, notes, and snippets. gist.github.com 2021. 2. 2.
[Git] 깃허브 시작하기. 총정리 (init, add, commit, push, pull) 1. git bash 실행 후 이름, 이메일 입력 git config --global user.name "myname" git config --global user.email "myemail@gmail.com" 2. 저장소 설정 후 깃 초기 설정 깃허브에 커밋할 파일이 있는 폴더로 가서 git init을 해야한다. (가상환경이 포함된 파일을 Commit하고자 한다면, 가상환경이 들어있는 폴더로 들어가서 커밋진행. 참고로 가상환경은 .gitignore를 해줘야하는데 이에 대한 자료는 여기에 0ver-grow.tistory.com/915) 3. 깃허브 저장소(repository) 연결 후 저장소 주소 확인 git remote add origin 나의 GIt repository 주소 에러 발생 : error:.. 2021. 2. 1.
Updates were rejected because the remote contains work that you do git push -u origin master 입력시 오류발생 hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. git pull 입력 후.. 2019. 7. 10.
git push 에러 발생 해결방법 에러내용 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 명령어를 실행하여 내 로컬 레포지토리의 내용을 github 원격 레포지토리로 업로드(push)하려 했는데 되지 않았다. 에러의 이유 github에서 레포지토리를 생성할 때, README.md 파일을 생성했기 때.. 2019. 7. 3.
git clone, push, pull 하기 1. 새 저장소 만들기 git을 clone하거나 commit할 폴더로 들어가서 git init 입력 2. 저장소 받아오기 로컬 저장소 복제하기 git clone /로컬/저장소/경로 원격 서버 저장소 복제하기 git clone 사용자명@호스트:/원격/저장소/경로 3. 변경 파일 인덱스에 추가하기 git add "파일명" 만약 인덱스에 추가할 파일이 많을시 git add . 으로 입력 4. commit하기 git commit -m "설명쓰기" 5. 기존 원격 저장소에 발행(PUSH)하기 git push origin master 여기서 master는 발행하려는 가지(branch) 이름 만약 기존 원격 저장소가 아닌 다른 원격 서버에 발행하려면 서버주소를 먼저 입력할 것 git remote add origin .. 2019. 6. 21.
반응형