繁体   English   中英

Git - 如何从远程重新设置的分支中提取最新更改

[英]Git - How to pull latest changes from a Branch that is rebased remotely

我面临的问题如下。 我创建了一个分支。 我做了几个提交,然后提出了一个拉取请求。

代码审查后,审查者发表了 2 条评论,并使用分支的远程 UI(Gitlab)进行了 rebase。 现在我的本地更改没有最新的提交。 但在我解决他的评论之前,我需要将更改带到本地。

我所做的,我真的不确定,它是否正确,是git fetch和拉出我的分支的来源,理论上应该是远程的。

git fetch
git pull origin myBranch

有没有更好的方法来做到这一点。 我在这种情况下苦苦挣扎,不确定我的方法是否正确。 谢谢!!

git fetch //Fetch all remote branches.

git checkout yourBranchName //Switch branches or restore working tree files

git pull origin yourBranchName //Fetch from and integrate with another repository or a local branch

git rebase mainBranchName yourBranchName //Reapply commits on top of another base tip

git push --force origin yourBranchName // Update remote refs along with associated objects forcefully

更多详情请查看

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM