The current branch is not configured for pull No value for key branch.master.merge found in configu

在尝试从Github拉取项目时遇到问题:The current branch is not configured for pull,提示找不到branch.master.merge配置。StackOverflow上的建议通常涉及命令行解决,但也可以在Eclipse中通过可视化界面操作修复:进入Window->Preference->Team->Git->Configuration,找到Repository Settings,粘贴缺少的[remote "origin"]和[branch "master"]配置,之后即可正常更新。

今天从Github 上pull 项目的时候遇到了一个问题:

The current branch is not configured for pull No value for key branch.master.merge found in configuration.

 没办法同步工程了,网上查了下,多数是命令解决。如下为stackoverflow上的解决方案

Your local master branch is not set up to track remote master branch.

You could do git pull origin master to tell git the explicit branch you want to pull or you add this to your .git/config:

[branch "master"]
  remote = origin
  merge = refs/heads/master

When you push to master for the first time, add the -u switch (git push -u origin master). This will set everything up automatically.

但是这样不太好操作,下面介绍如何在Eclipse上通过可视化界面操作。首先Window->Preference->Team->Git->Configuration->Repository Settings->选择你的repository,然后点open,你会看到config里的代码:

[core]
	repositoryformatversion = 0
	filemode = false
	logallrefupdates = true

对比其他git项目,发现少了几个东西——[remote "origin"]、[branch "master"]。

现在对症下药,从其他git项目考出[remote "origin"]、[branch "master"]copy 到缺失的config里。再做相应update就OK





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值