본문 바로가기

반응형

Git

(26)
자주쓰는 마크다운 명령어 정리 자주쓰는 마크다운 명령어 정리 줄바꿈 : 2번 스페이스
git push --set-upstream (git 최초 push) # git 최초 push 시 --set-upstream을 사용해야 하는 이유 upstream : 컴퓨터 네트워크 기술 용어에서 업스트림은 클라이언트나 로컬 기기에서 서버나 원격 호스트로 보내지는 데이터 또는 보내는 것을 의미한다. 자료전송은 여러 형태로 전송할 수 있고 자료가 로컬 기기에서 서버로 전송되는 속도를 업스트림 전송 속도라고 한다. 여기서 upstream은 로컬과 연결된 원격 저장소를 의미한다. git push --set-upstream A B 설명 : 로컬 A 저장소를 원격 저장소 B로 지정하여 B에 소스코드를 push하라 최초 1회로 하고 나면 원격 저장소가 설정되기 때문에 이후에는 할 필요가 없다. - 끝 -
Git 자격 삭제, 자격증명 Windows # Git 자격 삭제, 자격증명 Windows 1. 윈도우 자격증명 관리자 검색 후 설정 제어판 → 사용자 계정 → 자격 증명관리자 2. Windows 자격증명에서 git 정보 제거 windows 자격 증명 하단에서 깃허브 클릭 후 제거 3. 자격증명 추가 - 깃헙 아이디 등록 git config --global user.name"username" - 깃헙 이메일 등록 git config --global user.email"useremail" - push 및 자격 증명 git push -u origin master - 끝 -
remote 변경 (git remote 변경) # Git Remote 변경 1. 기존 repo 깔끔하게 정리 pull/push git pull git add . git commit -m "clean push" git push 2. 기존 repo remote 제거 git remote remove kim git remote remove origin git push origin {branch_name} ex) git push origin master 3. 새 repo remote 추가 git remote add origin https://github.com/계정/리포지토리 https://github.com/Nanninggu/tcp_ip_test_server.git 맨날 까먹네 까먹지 말자. ??? 까먹어도 된다 = 정리만 잘해놓자. ㅇ_ㅇ;; 추가, 브랜..
! [rejected] master -> master (fetch first) ! [rejected] master -> master (fetch first) git push origin +HEAD:master - 끝 -
Checkout # Git Checkout 진행하기 - Checkout을 통해 브랜치 전환하기 with InteliJ 1. 인텔리J를 연다. - 아래의 그림처럼 Git Log로 이동하여 해당 feature에 대해 checkout을 진행한다. 2. checkout 진행 위의 ta라는 feature를 Checkout을 하면 해당 브랜치 내용이 로컬에 동기화 된다. 까먹지 말자. - 끝 -
Bitbucket [rejected] 오류 해결하기 (매우 간단) # [rejected] 오류 해결하기 - 오류 내용은 아래와 같다. ! [rejected] HEAD -> master (fetch first) error: failed to push some refs to 'https://aaa.git' 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 pushi..
<CodeCommit> git checkout <branch_name> # Git checkout 과정 알아보기 - vs code에서 git checkout을 통해 local 저장소를 변경한다. 1. git branch 확인 - git branch 명령어로 조회해보면 2개의 branch를 확인할 수 있다. $ git branch main * master 2. git checkout을 통한 local 저장소 변경 git checkout main Switched to branch 'main' git checkout master Switched to branch 'master' 3. branch 별 폴더구조 확인 - main branch의 폴더구조는 아래와 같다. - master branch의 폴더구조는 아래와 같다. 만약 아래와 같은 오류 메세지가 발생하면 git add -A로..

728x90
반응형