git - 从特定分支拉 [英] git - pulling from specific branch

查看:101
本文介绍了git - 从特定分支拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了一个git仓库到我的开发服务器,然后切换到开发分支,但现在我不能做一个git pull来更新分支。



如何更新服务器上的代码?

解决方案

请参阅 git-pull man page


git pull [options] [< repository> [< refspec> ...]]


以及示例部分:


将远程分支合并到当前分支中:

$ git pull origin next


所以我想你想做类似的事情:

  git pull origin dev 

设置它,以便它在默认情况下在开发分支上执行:

  git branch --set -upstream-dev origin / dev 


I have cloned a git repository to my dev server and then switched to the dev branch but now I can't do a git pull to update the branch.

How do I update the code on the server ?

解决方案

See the git-pull man page:

git pull [options] [<repository> [<refspec>...]]

and in the examples section:

Merge into the current branch the remote branch next:

$ git pull origin next

So I imagine you want to do something like:

git pull origin dev

To set it up so that it does this by default while you're on the dev branch:

git branch --set-upstream-to dev origin/dev

这篇关于git - 从特定分支拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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