[git | Bitbucket] 터미널에서 Git commit push 하기

알린·2023년 10월 25일
0

git

목록 보기
1/4

Repository 생성

  1. Bitbucket 상단의 Create → Repository

  2. Project, Project name 등 선택 후 Create repository

  3. repository 페이지 우측 상단의 Clone 눌러서 복사

  4. 복사된 명령어 shell에 붙여넣기

git clone git@bitbucket.org:....

git commit

Git Branch 전략

Git flow

메인 브랜치

  • master : 라이브 서버에 제품으로 출시되는 브랜치(배포 가능한 상태)
  • develop : 다음 출시 버전을 대비하여 개발하는 브랜치(배포할 것 개발)

보조 브랜치(개발자 저장소에만 있는 브랜치)

  • feature : 새로운 기능을 추가하기 위한 브랜치
    develop에서 분기, 머지(--no-ff)
  • release : 배포를 위해 최종적인 버그 수정 브랜치 => QA
    develop에서 분기, develop&master에서 머지(-no-ff)
  • hotfix : 이미 배포된 버전에 생긴 문제 해결
    master에서 분기, develop&master에서 머지

1. branch 생성 → 작업한 파일들을 생성한 branch로 이동

git checkout -b feature/pr_training
mv main.c training_repo/
mv Makefile training_repo/
cd training_repo/
ls

2. git commit하기

git add .
git commit
------------------------------------
[커밋 메세지 작성]
.
.
.
-------------------------------------
:wq
  • git commit 실행 시 기본 에디터가 nano로 나타날 때
    vim을 기본에디터로 설정하기 위해 다음 과정을 수행한다.
cd ~
sudo update-alternatives --config editor
------------------------------------------
.
.
.
vim.basic 번호로 선택
------------------------------------------
cd ~/study/training_repo/
.
.
[나머지 작업 계속 수행]

3. git push 하기

git push origin feature/pr_training

Pull Request

  1. 해당 Repository 들어가기 → Pull Requests → Create pull request

  2. 내가 작업한 branch에서 master로 설정이 잘 되어있는지 확인 후 title과 description 작성 → 리뷰 받을 사람 선택 후 Pull Request

profile
Android 짱이 되고싶은 개발 기록 (+ ios도 조금씩,,👩🏻‍💻)

0개의 댓글