git - 无法对分支使用 git pull

标签 git git-flow

当我尝试执行 git pull 时,我从 git 收到此错误消息:

$ git branch
  develop
  feature/add-extra-student-automatically-to-cround
* feature/adjust-my-settings-as-pm
  feature/change_order_course_code_name
  feature/link_my_settings_to_create_survey
  feature/moodle-turnitin-message
  feature/remove_wrong_text_in_notifications
  feature/survey-reports_show-coursename-better-in-survey
  feature/yellow-box-course-schedule
  master
dac@dac-Latitude-E7450:/etc/proj/social$ git pull
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-to=origin/<branch> feature/adjust-my-settings-as-pm

如何解决该错误?

最佳答案

你可以:

git pull origin <your_branch>

为了防止这种情况,请使用 -u当您按下以便:

Set up <branchname>'s tracking information so <upstream> is considered <branchname>'s upstream branch. If no <branchname> is specified, then it defaults to the current branch.

它只会告诉 git当它尝试 pull 该分支时要查看哪里。

关于git - 无法对分支使用 git pull,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31854922/

相关文章:

regex - .gitignore 文件不在一个集合中

c# - Git:当我想要 LF 时 LF 被 CLRF 替换?

git - 尝试在 CentOS 5 上安装 GIT,有点迷路

git - 将开发分支中所做的修改移动到新的 git-flow 功能分支中?

Git:将标签转换为远程仓库中的分支

git - git-checkout 是否会在 fatal error 时保留 'half-done' 工作树更改?

git - 使用 GitFlow 进行 VSTS 发布定义

git - 重命名本地 GIT 分支会破坏 SourceTree 中的 Git Flow

git - 将 develop 分支设置为 pull 请求的默认分支

git - 将更改的文件从功能 merge 到修补程序 git 流