반응형
git branch 생성, 삭제
로컬 branch 생성(Deployment environment)
git branch [<options>] (-c | -C) [<old-branch>] <new-branch>
git checkout -b "testing"
$ git checkout -b "testing"
Switched to a new branch 'testing'
$ git checkout -b "staging"
Switched to a new branch 'staging'
branch 확인(현재 branch)
git branch --list
git branch
$ git branch
--
dev
master
testing
* staging
---
로컬 branch 이름 변경(dev -> development)
git branch [<options>] (-m | -M) [<old-branch>] <new-branch>
git branch -m dev development
로컬 branch 삭제
git branch [<options>] [-r] (-d | -D) <branch-name>
git branch -D dev
$ git branch -d dev
Deleted branch dev (was e178f0c).
$ git branch -D ggg
Deleted branch ggg (was f2b8f21).
branch 확인(현재 branch)
git branch
$ git branch
---
development
master
production
* staging
testing
(END)
---
원격 저장소에 branch 생성
git push origin staging
$ git push origin staging
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for staging, visit:
remote: http://gitlab.sangchul.kr/playground/merge_requests/new?merge_request%5Bsource_branch%5D=staging
remote:
To http://gitlab.sangchul.kr/playground.git
* [new branch] staging -> staging
원격 저장소에 branch 삭제
git push origin :dev
$ git push origin :dev
To http://gitlab.sangchul.kr/playground.git
- [deleted] dev
728x90
반응형
'리눅스' 카테고리의 다른 글
리눅스 history 명령어 (1) | 2021.01.28 |
---|---|
[GIT] 깃 태그(git tag) 생성, 삭제 (0) | 2021.01.27 |
CentOS 8에서 CentOS Stream으로 마이그레이션하는 방법 (1) | 2021.01.26 |
CentOS 8 Stream 설치(CentOS 8 스트림 설치) (0) | 2021.01.26 |
tput 명령어 (0) | 2021.01.25 |