您要求从远程 'origin' 拉取,但是未指定一个分支。因为这不是当前 分支默认的远程仓库,您必须在命令行中指定一个分支名。
来源:互联网 发布:windows蓝牙管理软件 编辑:程序博客网 时间:2024/05/30 23:51
我一直在使用github从相对较短的时间里,我一直用客户端执行提交和拉。我昨天从gitbash决定尝试它,我成功地创建了一个新的回购和提交文件。今天我做了更改存储库从另一台计算机,我承诺的改变,现在我回家,进行了更新我的本地版本,我得到:回购是我唯一因素和没有分支(硕士)。我在windows和拉从gitbash(http://prntscr.com/85picx)执行git状态:git分支:我做错了什么?
i've been using github from a relatively short period, and I've always used the client to perform commits and pulls. I decided to try it from the git bash yesterday, and I successfully created a new repo and committed files.
today I did changes to the repository from another computer, I've committed the changes and now I'm back home and performed a git pull
to update my local version and i get this:
There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull <remote> <branch>If you wish to set tracking information for this branch you can do so with: git branch --set-upstream develop origin/<branch>
the only contributor to this repo is me and there are no branches (just a master). I'm on windows and I've performed the pull from git bash (http://prntscr.com/85picx)
git status:
$ git status# On branch masternothing to commit, working directory clean
git branch:
$ git branch* master
what am i doing wrong?
(原文:Okay, how about a git remote -v
? What does that say?)
您可以指定分支你想把什么:或者你可以设置它,这样你的地方作为上游主分支跟踪github主分支:这个分支跟踪为您自动设置当你克隆一个存储库(仅为默认分支),但如果你添加一个远程到现有存储库设置跟踪自己。谢天谢地,git的建议使得很容易记住如何去做。
You could specify what branch you want to pull:
git pull origin master
Or you could set it up so that your local master branch tracks github master branch as an upstream:
git branch --set-upstream-to=origin/master mastergit pull
This branch tracking is set up for you automatically when you clone a repository (for the default branch only), but if you add a remote to an existing repository you have to set up the tracking yourself. Thankfully, the advice given by git makes that pretty easy to remember how to do.
(原文:perfect! it worked. so what happened is there was no "default branch" for a default "git pull"? that's why there was the error?)
网友:1.9——set-upstream在git中已被弃用。x,显然。未来你想使用类似,假设你已经签出大师。如果不是,将工作。
(原文:--set-upstream is deprecated in git 1.9.x, apparently. Going forward you'd want to use something like git branch -u origin/master
, assuming you've checked out master already. If not, git branch -u origin/master master
will work.)
网友:@BartRead更新使用新的清晰的语法。(替代)
(原文:@BartRead updated it to use the new clearer --set-upstream-to=
syntax. (which is the replacement for --set-upstream
))
网友:谢谢!
(原文:Thanks for that!)
网友:这似乎是一个令人遗憾的状况——我们真的需要手动设置为每个分支?为什么我们不能设置原点是默认远程然后有推/拉默认分支具有相同名称的起源吗?这是如此困难吗?
(原文:this seems like a sorry state of affairs - do we really need to set this manually for every branch? Why can't we just set origin to be the default remote and then have every push/pull default to the branch on origin with the same name? is this so hard?)
- 您要求从远程 'origin' 拉取,但是未指定一个分支。因为这不是当前 分支默认的远程仓库,您必须在命令行中指定一个分支名。
- Git拉取远程分支
- git从远程到本地,拉取分支,拉取项目,从其它分支拉取,推送,同步的操作
- git 拉取远程指定分支 pull本地不存在的分支
- git 拉取远程指定分支 pull本地不存在的分支
- 更新被拒绝,因为您当前分支的最新提交落后于其对应的远程分支
- github 更新被拒绝,因为您当前分支的最新提交落后于其对应的远程分支
- 更新被拒绝,因为您当前分支的最新提交落后于其对应的远程分支
- Git本地从某个分支上创建新分支以及拉取远程分支到本地分支
- git---使用git命令删除本地分支、远程分支、拉取其他分支的远程分支代码、创建查看本地远程分支
- git拉取远程分支并创建本地分支
- git拉取远程分支并创建本地分支
- git拉取远程分支并创建本地分支
- git拉取远程分支并创建本地分支
- git拉取远程分支并创建本地分支
- git拉取远程分支并创建本地分支和Git中从远程的分支获取最新的版本到本地
- git拉取远程分支并创建本地分支和Git中从远程的分支获取最新的版本到本地
- git拉取远程分支并创建本地分支和Git中从远程的分支获取最新的版本到本地
- 【汕头市选2014】舞伴(perm)
- 一种不断循环监测某一事件的方法
- 2017面试题收集
- c++中vector的用法详解
- 流式布局FlowLayout使用
- 您要求从远程 'origin' 拉取,但是未指定一个分支。因为这不是当前 分支默认的远程仓库,您必须在命令行中指定一个分支名。
- jsp模式-EL表达式&JSTL
- html、css、js文件加载顺序及执行情况
- java 内存泄露和jvm内存溢出区别
- apt-get 错误“无法获得锁 /var/lib/dpkg/lock...” 解决办法
- 数据挖掘十大经典算法
- flask笔记:11:gunicorn+gevent+nginx+flask部署,使用siege进行服务器压力测试
- UVA 437 The Tower of Babylon 【dp】
- 初识Linux