728x90
반응형
git 작업을 하다보면 git branch 이름 변경이 필요한 경우가 있다.
그럴경우 아래와 같은 방법으로 git branch 명을 변경 할 수 있다.
Local Branch 이름 변경 방법
-m 옵션을 통해 Local Branch의 이름을 변경 할 수 있다.
$ git branch -m {new_branch_name}
Remote Branch 이름 변경 방법
변경된 Local Branch를 Remote에 push해서 변경한다.
$ git push origin -u {new_branch_name}
이후 이전 브랜치를 delete 한다.
$git push origin --delete {old_branch_name}
728x90
반응형
'Programming > Git' 카테고리의 다른 글
[Git] webhooks 을 이용한 auto git pulling 구성 (git pull with webhooks) (13) | 2023.02.13 |
---|---|
[Git] git stash (git 임시 저장) (0) | 2022.05.17 |
[git] git push 되돌리기 - reset (0) | 2021.11.25 |
[Git] git push error - 토큰 인증 (Please use a personal access token instead) (0) | 2021.11.25 |
[git] Please make sure you have the correct access rights and the repository exists. (0) | 2021.11.17 |
댓글