简体   繁体   English

如何更新我的本地 master 分支以包含对我的本地 feature 分支所做的更改,这些更改在 origin (remote) master 上是最新的?

[英]How to update my local master branch to include changes made to my local feature branch that are up-to-date on origin (remote) master?

TLDR: My local feature branch has merged with remote origin/master, but my local master is not merging with remote master ("already up to date") and git pull/fetch doesn't work. TLDR:我的本地功能分支已与远程 origin/master 合并,但我的本地 master 未与远程 master 合并(“已经是最新的”)并且 git pull/fetch 不起作用。

The origin/master (remote) repo that I can see on github that my team is working on is up-to-date and working.我可以在 github 上看到我的团队正在开发的 origin/master(远程)repo 是最新的并且可以正常工作。 It includes everything from both my master branch and feature branch.它包括来自我的主分支和功能分支的所有内容。

My local master branch is missing data from the feature branch and is behind my team's remote origin/master.我的本地主分支缺少来自功能分支的数据,并且位于我团队的远程源/主分支之后。

My local feature branch is ahead of my local master branch but behind the origin/master.我的本地功能分支在我本地主分支之前,但在 origin/master 之后。

How do I synchronize my local branches to be at the same level?如何将本地分支同步到同一级别?

When I git pull/fetch on my local master it says it's up to date, but it's not.当我在本地 master 上 git pull/fetch 时,它说它是最新的,但事实并非如此。

Why did this happen?为什么会这样? Should I have only merged my local feature with my local master branch, and then only merge my local master with remote origin/master?我是否应该只将本地功能与本地主分支合并,然后只将本地主分支与远程源/主分支合并?

Edit: It seems like my branches have only pulled from remote/origin master when I have pushed my changes.编辑:当我推送我的更改时,我的分支似乎只从远程/源主服务器中提取。

If you already merge your feature to master and don't have any missing changes on master, you can simple reset your master to origin.如果您已经将您的功能合并到母版并且母版上没有任何丢失的更改,您可以简单地将您的母版重置为原点。 Go to master branch and try: git reset --hard origin/master .转到 master 分支并尝试: git reset --hard origin/master

I'm not sure why this happens, but already happened to me and I fix by this way.我不确定为什么会发生这种情况,但已经发生在我身上,我通过这种方式修复。

暂无
暂无

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

相关问题 git pull说本地主分支是与原始主分支最新的; 事实并非如此 - git pull says local master branch is up-to-date with origin master branch; it isn't 获取我的本地功能分支与远程主分支没有过期的信息 - Get information that my local feature branch is not out-of-date with the remote master branch 使我的个人功能分支与我分叉的项目的主分支保持最新 - Keeping my personal feature branch up-to-date with the master branch of a project I 've forked 我无法将其推送到我的存储库,它说您的分支是“上游/主服务器”的最新信息,但我对文件进行了更改 - I can't push to my repository it says Your branch is up-to-date with 'upstream/master' but I have made changes to my files 为什么我的远程 master 分支中的更改没有被拉入我的本地 master 分支? - Why aren't changes in my remote master branch being pulled into my local master branch? 将其与本地主服务器合并后,是否应该删除LOCAL remote / origin / master分支? - Should I delete the LOCAL remote/origin/master branch after I have merged it with my local master? 用我的本地替换远程主分支 - Replace remote master branch with my local 将我的本地分支与远程主站点合并 - merging my local branch with remote master 如何通过丢弃所有更改来将所有更改从远程源主分支复制到本地的新分支 - How to copy all changes from the remote origin master branch to a new branch on local by discarding all changes of it 将本地分支更改为master并更新远程master - Change local branch to master and update remote master
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM