remote_branch_name是你要删除的远程分支。 要查看任何远程分支,请使用以下命令: gitbranch-a -a标志(--all的别名)显示所有分支——本地和远程。 我有两个名为master和test的本地分支以及两个远程分支origin/master和origin/test。-r是--remotes的别名,仅显示远程仓库。 删除远程origin/test分支,所以我使用命令:...
git branch (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>] git branch --unset-upstream [<branchname>] git branch (-m | -M) [<oldbranch>] <newbranch> git branch (-c | -C) [<oldbranch>] <newbranch> git branch (-d | -D) [-r] <branchname>… git branc...
When you clone a repository, it generally automatically creates amasterbranch that tracksorigin/master. However, you can set up other tracking branches if you wish — ones that track branches on other remotes, or don’t track themasterbranch. The simple case is the example you just saw,...
remotes/origin/branch3 remotes/origin/branch4 remotes/origin/branch5 “` 上面的输出中,除了本地分支(带`*`号)外,还列出了远程分支。 3. `git branch –all`:该命令和`git branch -a`效果相同,用于查看所有的分支。 4. `git branch –list`:该命令也可以用来查看所有的分支,效果与`git branch`相同。
在列中显示分支列表。选项语法见配置变量`column.branch`。--column`和--no-column`没有选项,分别相当于’always’和’never'。 这个选项只适用于非粗话模式。 -r --remotes 列出或删除(如果与-d一起使用)远程跟踪的分支。 与`--list`结合使用,以匹配可选的模式(s)。
例如,如果远程HEAD指向next,则git remote set-head origin -a会将符号引用refs/remotes/origin/HEAD设置为refs/remotes/origin/next。只有当refs/remotes/origin/next已经存在时才有效;如果不存在,则必须首先进行获取。 使用<branch>显式设置符号引用refs/remotes/<name>/HEAD。例如,git remote set-head origin ...
使用git branch -a命令查询出的远程分支内容如下 : 代码语言:javascript 复制 *master remotes/origin/6-remotes/origin/HEAD->origin/master remotes/origin/feature1 remotes/origin/master * master是本地仓库的 master 分支 ; remotes/origin开头的是远程分支 ; ...
(分支名可简写或完整编写,参考上面↑) $ git push <remote> <branch-a> <branch-b> # 推送并设置上游分支(-u全称--set-upstream) $ git push -u <remote> <refspec> # 将本地仓库镜像到远程仓库(包括但不限于refs/heads/, refs/remotes/和refs/tags/) $ git push --mirror <remote> # 推送所有...
远程跟踪分支:remotes/origin/<branchName> 本地分支名:<branchName> HEAD指针: 指向当前分支的最新提交,参考:Git之旅(8):HEAD是啥? 命令 git fetch 访问远程仓库,拉取你还没有的数据。 git stash 贮藏与清理,将本地修改和暂存区的内容存放到一个栈上,你可以在任何时候应用这些改动(甚至不同分支)。
git branch -r看远程跟踪分支(remote-tracking branches)情况,--remotes。 git branch -d <branch>;删除 <branch>,--delete; git branch -a;查看本地和远程所有分支情况,--all; git branch -m <new-branch-name>:修改当前分支名,详见How To Change Branch Name on Git。