<p>现在我在master分支上,工作目标是干净的,也没有需要commit的:<br/><br/>&nbsp;&nbsp;&nbsp; $ git branch<br/>&nbsp;&nbsp;&nbsp; * master<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; release<br/>&nbsp;&nbsp;&nbsp; &nbsp;<br/>&nbsp;&nbsp;&nbsp; $ git status<br/>&nbsp;&nbsp;&nbsp; On branch master<br/>&nbsp;&nbsp;&nbsp; Your branch is up-to-date with &#39;origin/master&#39;.<br/>&nbsp;&nbsp;&nbsp; nothing to commit, working directory clean<br/><br/>新建远程分支<br/><br/>新建一个本地分支:<br/><br/>&nbsp;&nbsp;&nbsp; $ git checkout -b dbg_lichen_star<br/><br/>查看一下现在的分支状态:<br/><br/>&nbsp;&nbsp;&nbsp; $ git branch<br/>&nbsp;&nbsp;&nbsp; * dbg_lichen_star<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; master<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; release<br/><br/>星号(*)表示当前所在分支。现在的状态是成功创建的新的分支并且已经切换到新分支上。<br/><br/>把新建的本地分支push到远程服务器,远程分支与本地分支同名(当然可以随意起名):<br/><br/>&nbsp;&nbsp;&nbsp; $ git push origin dbg_lichen_star:dbg_lichen_star<br/><br/>使用git branch -a查看所有分支,会看到remotes/origin/dbg_lichen_star这个远程分支,说明新建远程分支成功。<br/>删除远程分支<br/><br/>我比较喜欢的简单方式,推送一个空分支到远程分支,其实就相当于删除远程分支:<br/><br/>&nbsp;&nbsp;&nbsp; $ git push origin :dbg_lichen_star<br/><br/>也可以使用:<br/><br/>&nbsp;&nbsp;&nbsp; $ git push origin –delete dbg_lichen_star</p><p><br/></p><p><br/></p><p>chmod -R 777 conf</p><p><br/></p><p><br/></p><p>新建仓库:</p><p>在参考目录下执行: git init<br/></p><p><span style="color: rgb(79, 79, 79); font-family: &quot;Microsoft YaHei&quot;, &quot;SF Pro Display&quot;, Roboto, Noto, Arial, &quot;PingFang SC&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">chmod -R 777 your-repositoryname.git</span><br/></p><pre style="white-space: normal; color: rgb(50, 62, 50); font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(207, 204, 199); text-decoration-style: initial; text-decoration-color: initial;">git&nbsp;config&nbsp;receive.denyCurrentBranch&nbsp;ignore</pre><p><br/></p><p>这两种方式都可以删除指定的远程分支<br/>——————— <br/>作者:-FIGHTING- <br/>来源:CSDN <br/>原文:https://blog.csdn.net/u012701023/article/details/79222731 <br/>版权声明:本文为博主原创文章,转载请附上博文链接!<br/></p>