Git:Why Re-based 后我的叉子仍然落后于原始 repo master?

Git:Why after Re-basing still my fork is behind the original repo master?

我从 Github 分叉了一个 repo,然后创建了一个名为 process 的分支,我已经开始在这个存储库上工作,并且我在我的分支 progress.

现在我将更改推送到 github 它向我展示了这个 This branch is 7 commits ahead, 16 commits behind jwasham:master. 现在我通过检查我的流程分支并添加上游解决了这个问题

$ git branch --set-upstream-to=origin progress

然后我进行了变基,所以我的更改出现在那些在原始回购上所做的提交之上,并且是这样完成的

$ git pull --rebase First, rewinding head to replay your work on top of it... Fast-forwarded process to 266048d8326bde6f1cb137d8b898fc2fff645f94.

但是当我试图将其推送到 github 时,它显示

$ git pu
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/uppusaikiran/repo_name.git
   0569dcf..266048d  process -> process

很明显什么都没有改变,我仍然有同样的问题This branch is 7 commits ahead, 16 commits behind jwasham:master.

如何解决这个问题,我究竟在哪里出错以及如何在更新之上使用我的更改来更新我的分叉?

许多人建议的简化问题那个问题很难理解

你做的时候

$ git branch --set-upstream-to=origin progress

您告诉 git 您的本地分支机构 progress 正在跟踪 origin/progress 因此

$ git pull --rebase

正在根据 origin/progress 而不是您希望的 jwasham:master

您需要将 jwasham:master 中的更改提取到您的本地克隆中,然后您可以进行变基。

例如:

$ git remote add jwasham <URL>
$ git fetch --all
$ git rebase jwasham/master

然后您可以推送到您的 github-clone - 如果您之前发布了您的分支,很可能使用 --force。