[精讚] [會員登入]
282

how to rename git branch

rename git branch

分享此文連結 //n.sfs.tw/14734

分享連結 how to rename git branch@der amateur
(文章歡迎轉載,務必尊重版權註明連結來源)
最後編修
2020-08-30 22:27:55 By
 

on some growing projects, there are git repositories to deal with developement situations,

however, a fatal naming issue may cause some maintenance problem.

I was facing this awkward issue recently,

so I had to rename my git repo's branch name locally and remotely

it's very basic, just deleted your remote branch and push a new one up,

so I followed the direction I looked up on google,

https://gitbook.tw/chapters/github/delete-remote-branch.html

http://note.drx.tw/2012/11/renaming-git-branch.html

1. change your directory loaction to where you want to deal with your project

2. checkout to another branch which is not you are going to rename it,

3. rename local branch using: git branch -m old_branch_name new_branch_name

4. using: git push origin :branch_name to delete remote branch

5. pushing new branch name using: git push origin new_branch_name

6. because your banch name changed, git will lost branch location locally and remotely, so using: git branch --unset-upstream

that's all.

 

 

END

你可能感興趣的文章

how to adjust text line spacing on macos terminal it's a annoying detail while generating qrcode on terminal

packages before adding as module into Intellij IDEA project, need to handle git repostory first. if you wish doing VCS for your code packages, do git setup first, before adding them into Intellij IDEA

how to rename git branch rename git branch

import csv into jira to create mass issues import csv into jira to create mass issues

JIRA instance migration phase3: upgrading jira trying to upgrade jira from 7.6.1 to 8.x

how to modify a service's ulimits on host OS modify ulimits

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

how to modify a service's ulimits on host OS modify ulimits

how to rename git branch rename git branch

steps to pass-through usb smart card reader for virtualbox how to pass through usb-smart-card-reader from ubuntu host to virtualbox vm

JAVA Maximum Length Difference You are given two arrays a1 and a2 of strings. Each string i

how to adjust text line spacing on macos terminal it's a annoying detail while generating qrcode on terminal