简体   繁体   English

git从远程分支的本地分支变基础

[英]git rebasing from local branch off remote branch

I have a local branch test , and I want to rebase off of the remote branch test , how would I do this? 我有一个本地分支test ,我想重新关闭远程分支test ,我该怎么做? I have tried git rebase origin test , but the changes someone pushed a short while ago aren't being rebased into my local? 我已经尝试过git rebase origin test ,但是有人在不久前推出的更改并没有被重新引入我的本地?

You have to first fetch data from the server (this won't affect your branch, but will update the branch origin/test with the remote changes). 您必须首先从服务器获取数据(这不会影响您的分支,但会使用远程更改更新分支origin/test )。

git fetch

Then you can do your rebase 然后你可以做你的rebase

git rebase origin/test

You can now push your branch test 您现在可以推动您的分支test

git push origin test

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

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