相关疑难解决方法(0)

git:为什么我不能在壁球合并后删除我的分支?

我有一个git仓库mainline(相当于master)和一些本地功能分支.例如:

$ git branch
* mainline
  feature1
  feature2
  feature3
Run Code Online (Sandbox Code Playgroud)

当我执行以下操作时,我能够将功能分支中的所有编辑内容合并为一个提交到mainline:

$ git checkout mainline
$ git pull
$ git checkout feature1
$ git rebase mainline
$ git checkout mainline
$ git merge --squash feature1
$ git commit
$ git push
Run Code Online (Sandbox Code Playgroud)

我的问题是,在这一点上,当我尝试删除feature1分支时,它告诉我它没有完全合并:

$ git branch -d feature1
error: The branch 'feature1' is not fully merged.
If you are sure you want to delete it, run 'git branch -D feature1'.
Run Code Online (Sandbox Code Playgroud)

是什么导致这个错误?我以为git merge --squash …

git merge git-merge

20
推荐指数
2
解决办法
3724
查看次数

标签 统计

git ×1

git-merge ×1

merge ×1