简体   繁体   English

如何在Sourcetree中使用Git Rebase?

[英]how do a Git Rebase in Sourcetree?

I want my local master branch to include the commit 'fixed js errors' and be rebased into origin/master. 我希望我的本地主分支包含提交'fixed js errors'并重新定位到origin / master。
在此输入图像描述

I started the process like this: 我开始这样的过程: 在此输入图像描述

Which leads me to this: 这让我想到了这个: 我的Sourcetree

But as you can see, I'm asked to pull before I push. 但正如你所看到的,在我推动之前,我被要求拉。 And every time I pull I end up with a situation depicted in the first image. 每次我拉动时,我都会遇到第一张图片中描绘的情况。 What am I doing wrong?! 我究竟做错了什么?! Thanks, 谢谢,

Your original structure would not support rebasing. 您的原始结构不支持变基。 Let's say you had a commit to your local master and someone else had committed (and pushed) another change to origin/master . 假设你有一个对你当地master的承诺,而其他人已经提交(并推动)另一个对origin/master更改。 In this scenario, you could rebase your commit on top of the other commits. 在这种情况下,您可以在其他提交之上重新提交您的提交。

Your scenario has a commit from a completely different branch. 您的方案具有来自完全不同的分支的提交。 You would either need to merge your other branch into master , or you could cherry pick that one commit and apply to the master branch. 您可能需要将其他分支合并为master ,或者您可以选择一个提交并应用于master分支。

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

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