TortoiseGit Bad file number 解决方法

本文介绍了解决TortoiseGit pull操作中出现的“/bin/sed:Badfilenumber”错误的方法,通过调整配置文件中的远程仓库引用设置,成功解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

作者:zhanhailiang 日期:2015-01-07

直接使用命令行git pull操作正常,如下:

D:\vipshop\mstats\mstats-monitor>git pull
Updating 5050c42..e8b3bd9
Fast-forward
 public/css/app.css              | 30 ++++++++++++++++++
 public/js/page.counts.js        | 68 +++++++++++++++++++++++++++++++++--------
 views/counts.html               |  8 +++++
 views/includes/module_list.html |  3 +-
 4 files changed, 96 insertions(+), 13 deletions(-)

但是使用TortoiseGit pull时报错“/bin/sed: Bad file number”,详情如下:

git.exe pull -v --progress       "origin"

/libexec/git-core/git-sh-setup: line 81: /bin/sed: Bad file number
From http://gitlab.tools.vipshop.com/wade.zhan/mstats-monitor
= [up to date]      master     -> origin/master
C:\Program Files (x86)\Git/libexec/git-core\git-pull: line 268: /bin/tr: Bad file number
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.


git did not exit cleanly (exit code 1) (2090 ms @ 2015/1/7 10:08:05)

根据提示“Your configuration specifies to merge with the ref 'master' from the remote, but no such ref was fetched.”,指的是merge远端引用master,但是fetch不到该引用。

查了下git help pull命令详情:

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

怀疑是因为缺少参数导致,尝试下手动执行完整命令,如下:

D:\vipshop\mstats\mstats-monitor>git.exe pull -v --progress       "origin" master

From http://gitlab.tools.vipshop.com/wade.zhan/mstats-monitor
 * branch            master     -> FETCH_HEAD
 = [up to date]      master     -> origin/master
Already up-to-date.

这里就定位到问题,应该缺省参数导致,右键菜单 TortoiseGit->Settings->Git->Edit local .git/config,在[branch "master"]修改remote = origin master,如下图:

git_branch

然后就可以正常使用TortoiseGit pull了:

git.exe pull -v --progress       "origin" master

From http://gitlab.tools.vipshop.com/wade.zhan/mstats-monitor
* branch            master     -> FETCH_HEAD
= [up to date]      master     -> origin/master
Already up-to-date.

Success (2121 ms @ 2015/1/7 10:08:38)

参考文章:

  1. http://blog.youkuaiyun.com/renfufei/article/details/41648061
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值