首页 > 解决方案 > 从修改后的拉取请求中取回提交

问题描述

我有人向我发送了关于我的团队正在工作的项目的拉取请求。但是,在将其合并到工作分支之前,我需要进行很多更改。我不知道该怎么做,所以我搜索它并遇到了这个。它展示了如何获取拉取请求并进行更改、评估它然后合并到 master。我这样做并被放在了分支中e95c037

我做了很多更改并且很满意并准备合并它。当我签出 master 时,我收到一个警告,说你要留下一堆提交。然后当我按照最后两个步骤

git add --all
git commit -m "Modified PR"

没啥事儿。我无权访问我的新更改。我试过检查e95c073是这样说的:

Note: checking out 'e95c037'.

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 e95c037... Change name

但我的文件不存在。新的目录结构(我在修改拉取请求时创建的)但这些目录中没有文件。

我失去了一切吗?如果我可以取回所有内容,我该如何合并这个修改后的拉取请求?

标签: gitpull-request

解决方案


推荐阅读