小编tot*_*amp的帖子

Git将不同分支中的旧提交推送到新分支

我已经在GIT上挣扎了一段时间,因为它做了一些奇怪的事情。

我有一个初始代码的基本提交。

好的,接下来我创建一个分支来进行编辑,提交和推送:

git checkout -b feature/feature1
git commit -m "added feature1"
git push origin feature/feature1
Run Code Online (Sandbox Code Playgroud)

现在,我对该功能进行拉取请求。

之后,我更改分支并更新例如:

git checkout -b chore/update-framework
git commit -m "updated framework"
git push origin chore/update-framework
Run Code Online (Sandbox Code Playgroud)

在这一点上,当我尝试第二次推送的请求时,它包含了所有功能的第一次提交。因此,该提交中所有更改的文件都在新的请求中,而旧的请求仅包含功能文件。

我究竟做错了什么?

git github pull-request

3
推荐指数
2
解决办法
2057
查看次数

标签 统计

git ×1

github ×1

pull-request ×1