如何在Babun中升级Git

问题描述 投票:13回答:5

我刚安装:

https://github.com/babun/babun

在Windows 8中,但如何将Git升级到最新版本?

它附带

{〜}»git --version~git version 1.7.9

我试过了:

 pact install git-2.0.4.tar

其中git-2.0.4.tar位于当前目录中。我也尝试复制它/ setup但我仍然得到这个错误:

{ ~ }  »  pact install git-2.0.4.tar
Working directory is /setup
Mirror is http://mirrors.kernel.org/sourceware/cygwin/
setup.ini taken from the cache

Installing git-2.0.4.tar
Package git-2.0.4.tar not found or ambiguous name, exiting
windows git babun
5个回答
18
投票

pact update git

刚刚更新到最新版本的Git,2.5.3。


20
投票

使用Cygwin安装程序更新安装:

  1. http://cygwin.com/setup-x86.exe下载Cygwin安装程序
  2. 运行安装程序并使用.babun \ cygwin目录(很可能是C:\ Users \ your-username \ .babun \ cygwin)作为根安装目录
  3. 单击安装程序。默认情况下,它会升级所有包。

重新安装git也可能有效:

pact remove git
pact install git

重新安装速度更快,但完整的Cygwin升级更安全,因为所有依赖项也会自动升级。


3
投票

更新后我遇到了git问题:

警告:Git推送策略设置为不受支持 - 更改为“匹配”错误:无法将git push.default设置为“匹配” - 可能导致问题...无法启动插件[git]

但是在使用以下命令卸载它之后,它再次起作用。

pact remove git

我想现在babun使用git的windows安装..


1
投票

尝试使用git更新pact update git安装似乎有效(在编写本文时) - 找到适当的镜像并下载并成功安装包。

然而,正如@ torben-vesterager在2019年3月13日指出的那样,这个版本的git可能会导致错误。我看到了和他一样的错误:

WARNING: Git push strategy set to  which is unsupported - changing to 'matching'
ERROR: Cannot set git push.default to 'matching' - may cause problems...
Error on or near line 16, last command 'trap 'catch_err "${previous_command}" ${LINENO}' ERR';
Error on or near line 4, last command 'source "$babun_tools/git.sh"';
Could not start plugin [git]

进一步调查显示,这实际上是因为git二进制文件与Cygwin本身的已安装版本不兼容 - 在Windows上下文中运行git.exe会对错误链接的DLL发出适当警告(对于未捕获确切消息而道歉)。

要正确解决此问题,请关闭所有Babun窗口并从Babun主目录运行update.bat。这会将Cygwin更新到最新版本(babun update不会这样做),包括更新版本的git

» uname -a
CYGWIN_NT-10.0-WOW a5044 3.0.7(0.338/5/3) 2019-04-30 18:04 i686 Cygwin
» git version
git version 2.21.0

0
投票

git更新后:

WARNING: Git push strategy set to  which is unsupported - changing to 'matching'
ERROR: Cannot set git push.default to 'matching' - may cause problems...
Error on or near line 16, last command 'trap 'catch_err "${previous_command}" ${LINENO}' ERR';
Error on or near line 4, last command 'source "$babun_tools/git.sh"';
Could not start plugin [git]

似乎它回到了CygWin ......但首先我会试试Linux的Windows子系统

wslgit.bat :(在x64拱门上)

@echo off
setlocal enabledelayedexpansion
set command=%*
bash.exe -c 'git %command%'

0
投票

很多事情都是偶然发生的。这是其中之一。

我喜欢使用Babun,但现在当Babun停止使用时,我知道git版本将成为一个问题(是v2.1.4)。

我的工作计算机没有连接到互联网,所以我通常必须下载完整的安装文件并在传输后运行它们。没有互联网依赖性。

我安装了Git-Bash但我更喜欢Babun终端。

在Babun里面我跑了pact update git,但我知道当然这不起作用,因为我没有连接到互联网。

这发生在我跑pact update git的时候

  1. pact删除了git
  2. 协议抱怨镜子不可用(毫不奇怪)
  3. 协议放弃了

然后我想,现在Git已经离开,这就是Babun。

我输入git version,那里是git version 2.21.0.windows.1

也许不是每个人最好的解决方案,但是当你已经安装了Git-Bash并且没有互联网连接时它可以工作。

© www.soinside.com 2019 - 2024. All rights reserved.