본문 바로가기

반응형

Git/Git & CodeCommit & Bitbucket

(5)
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로..
신규 Branch 생성 후 파일 업로드하기 # 신규 Branch 생성 후 파일 업로드 하기 1. 기본 명령어 # git init, 해당 폴더를 git에 등록 git init # git remote add {remote_name} https://github.com/~.git git remote add origin https://github.com/~.git # git pull: 원격 저장소 정보를 가져오면서 local branch와 병합한다. git pull origin 브런치이름 # Branch를 변경한다. -b 명령어는 브랜치가 없으면 생성한다. git checkout -b 브런치이름 # 신규 파일을 추가한다. git add . # 신규 파일을 commit 한다. git commit -m "어쩌구" # git push {원격 Repository..
특정 Branch만 clone 하기 # 특정 브랜치만 클론하는 방법 (나는 이렇게 함.) - 해당 폴더를 연다. cd 생성한 폴더로 이동 - git 저장소로 만든다. git init - 원격 저장소를 연결한다. git remote add origin https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/Jenkins-Test - 원격 저장소 내용을 가져온다. git pull origin master --allow-unrelated-histories - CodeCommit에서 기본 브랜치를 변경한다. aws codecommit update-default-branch --repository-name MyDemoRepo --default-branch-name MyNewBranch - git..
원격 Branch 복사 후 신규Branch 생성 및 파일 추가하기 # 원격 브랜치를 복사 후 신규 브랜치를 생성 및 신규 파일 추가하는 작업 원격브랜치를 가져와서 (chekout 해서) 새로운 브랜치를 생성하면서 pull 받고 새로운 파일을 추가해서 새로운 브랜치에 기존에 pull받은 리소스와 추가한 리소스 전체를 업로드 하기 - Flow를 확인하면 아래와 같다. - 자세한 작업 내역은 아래 링크를 확인... 2023.11.10 - [Git/Git & CodeCommit] - 신규 Branch 생성 후 파일 업로드하기 신규 Branch 생성 후 파일 업로드하기 # 신규 Branch 생성 후 파일 업로드 하기 1. 기본 명령어 # git init, 해당 폴더를 git에 등록 git init # git remote add {remote_name} https://github..

728x90
반응형