[英]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.