如何“拉"到从本地分支变成另一个分支? [英] How to "pull" from a local branch into another one?

查看:72
本文介绍了如何“拉"到从本地分支变成另一个分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这听起来很简单,但我只是想不通.我前一阵子做了一个实验分支,现在我想把自从完成以来在master上发生的所有更改都引入进来.这都是本地的.我想从本地主服务器拉到本地my_branch,但是我做不到.这似乎不起作用,告诉我master不是git存储库:

This sounds so simple, but I just can't figure it out. I made an experimental branch a while ago, and now I'd like to pull in all the changes that happened on master since I made it. This is all local. I want to pull from local master into local my_branch, but I can't do it. This doesn't seem to work, telling me that master isn't a git repository:

git pull master

推荐答案

您必须告诉git从何处提取信息,在这种情况下,是从当前目录/存储库中提取信息:

you have to tell git where to pull from, in this case from the current directory/repository:

git pull . master

但是在本地工作时,通常只需要调用合并(内部调用合并):

but when working locally, you usually just call merge (pull internally calls merge):

git merge master

这篇关于如何“拉"到从本地分支变成另一个分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆