简体   繁体   English

分叉分支在主分支后面提交1次时更新

[英]Forked branch is updated while being 1 commit behind the master branch

I am working on a forked repo. 我正在做一个分叉的仓库。

I pushed a commit yesterday which was merged with the master branch a couple of hours later. 我昨天提交了一个提交,几个小时后又与master分支合并。 I kept working on my fork without pulling in the new merged master, so my local files are technically "1 commit behind". 我一直在继续工作,而没有引入新的合并主服务器,因此我的本地文件在技术上是“落后于1个提交”的。

I usually git pull upstream to keep my local files up-to-date, but this time my local files are updated and I do not want to lose my changes because I will commit them right after the git pull upstream . 我通常会git pull upstream以使本地文件保持最新,但是这次我的本地文件已更新,并且我不想丢失所做的更改,因为我将在git pull upstream之后立即提交它们。

My question is: How do I merge my local repo with the master repo while keeping my changes so I can then commit and push the updates files? 我的问题是:如何在保留更改的同时合并本地存储库和主存储库,以便随后提交并推送更新文件?

Probably you are looking for: 可能您正在寻找:

git pull --rebase upstream master

This will update your repo and put your changes ahead. 这将更新您的存储库并提前进行更改。

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

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