我创建了远程分支名称 REMOTE1 并进行了更改并更新了 REMOTE1。同样,我的同事们也在 MASTER 上工作并进行了大量的更改。
现在我必须将远程/MASTER 的更改合并到远程/REMOTE1。
任何人都可以帮助我在这种情况下遵循最佳工作流程。我尝试了以下步骤
git checkout master
git pull
git checkout REMOTE1
git rebase master
这么多合并冲突,我已经解决了......
当我尝试 git status
# On branch REMOTE1
# Your branch and 'origin/REMOTE1' have diverged,
# and have 16 and 10 different commit(s) each, respectively.
#
我不确定这是什么意思???
然后我尝试推入我的远程分支 REMOTE1 并收到以下错误
! [rejected] HEAD -> REMOTE1 (non-fast-forward)
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
在任何变基操作之前
--- A - B - C - D MASTER
\
P - Q - R REMOTE1
完成上述步骤后
MASTER LOCAL REMOTE1
| |
--- A - B - C - D - P - Q - R
\
P - Q - R REMOTE1