只有原始master分支有一个git repo。 如何创建类似 http://nvie.com/posts/a-successful-git-branching-model
无论如何,当前的母版已被用作开发分支。 因此想重命名要开发的远程主机,但每次都会收到以下错误。
我目前正在关注:
git branch -m master develop
并获得
remote: error: By default, deleting the current branch is denied, because the next
remote: 'git clone' won't result in any file checked out, causing confusion.
remote:
remote: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: current branch, with or without a warning message.
remote:
remote: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master
To C:/somewhere
! [remote rejected] master (deletion of the current branch prohibited)
我没有适当的访问ssh到服务器的权限,并按照此处的指示和说明更改了“ receive.denyDeleteCurrent”。 http://dcsg.me/tutorials/how-to-allow-remove-master-branch-from-git/
从本地克隆存储库那边我有什么选择?
编辑 需要保留所有提交历史记录。
答案 0 :(得分:1)
首先创建一个新分支,将其切换,然后删除旧分支。
git checkout -b [name_of_your_new_branch]
-创建
git checkout [name_of_your_new_branch]
-切换
git push origin [name_of_your_new_branch]
-推送到服务器
现在,您应该可以删除分支了。
当然,您正在尝试删除看起来像master的东西,这是个坏主意。您很可能只想使用分支名称develop
来执行上述操作,而不想删除master
。
您将始终有多个分支。