git - 新用户尝试 pull 并收到一些令人困惑的消息

标签 git

我是 git 的新手。我一直主要将内容 checkin 存储库,但现在我想从其他开发人员那里获取最新更改。

我试着简单地执行一个命令,比如 git pull something run,但它返回了这样的消息:

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>

然后我做了 git pull my_branch_name

返回结果是这样的:

fatal: 'develop' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

但在那之前我已经完成了 git checkout my_branch

有人可以告诉我我做错了什么以及我如何才能简单地获取已 checkin 的最新文件吗?

谢谢!

最佳答案

我认为您在 pull 时错过了 Remote 的名称:

git pull <remote> my_branch_name

运行这个命令:

git remote -v

然后检查您要从中提取的 Remote 的名称是什么

编辑:

如果你是 Git 新手,我会推荐你​​ this book .它涵盖了从基础到高级的主题,易于理解和阅读

关于git - 新用户尝试 pull 并收到一些令人困惑的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12054223/

相关文章:

git - 无法将 Spring Cloud Config Server 与远程 Git 集成

git - 将 git 与 Dropbox 文件夹中的项目一起使用

git - 如何设置 git config 以使用域的特定 key ?

git - git 跟踪和 git 暂存的概念

git - 比较强制推送的 GitHub pull 请求的新旧版本

django - Git merge 忽略的迁移文件

git - 在 Android Studio 中访问 git 子模块

ruby-on-rails - 我可以在 heroku 应用程序的 environment.rb 中运行 `git describe` 吗?

git - 切换到另一个 Git 标签

git - "Could not open a connection to your authentication agent",即使在 ssh-agent 启动后 ssh-add 错误