Hek*_*men 6 git git-branch gitlab
我在 GitLab 中显示分支时遇到问题。在显示的分支之间有两个被删除了。我相信这是因为他们的名字origin/ondrat/xxxxx和origin/vladan/xxxxx. 所以完整路径 pathspec 是origin/origin/ondtrat.... 这两个分支不会出现在列表中,git branch -r并且在 GitLab UI 中无法删除。当我尝试在 GitLab 中删除它们时,没有任何反应。
有没有办法消除它们或者它是一个错误?
正如一位同事(内部GitLab维护者)所解释的,the branches are gone but the tracking information is not.要摆脱跟踪信息:
选项1
$ git fetch --prune
Run Code Online (Sandbox Code Playgroud)
选项 2(在干净的分支上)
$ git merge --prune
Run Code Online (Sandbox Code Playgroud)
我遇到了一个有点类似的情况,合并到master后远程分支被删除,我删除了本地分支,但是远程分支仍然出现在 git branch -a
[samveen@development opsgenie_webhook]$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/submodules
remotes/origin/update1
Run Code Online (Sandbox Code Playgroud)
此外,在结帐时,回购的状态是detached HEAD:
[samveen@development opsgenie_webhook]$ git checkout remotes/origin/submodules
M libs
Note: checking out 'remotes/origin/submodules'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 6d9727e... Add target first_init
Run Code Online (Sandbox Code Playgroud)
$ git remote add gitlab <url>
$ git push gitlab --delete <branchname>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5353 次 |
| 最近记录: |