如何在Babun中升级Git



我刚刚安装了:

https://github.com/babun/babun

在windows 8,但我如何升级Git到最新版本?

随附

{~}»git——version ~Git version 1.7.9

I did try:

 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

使用Cygwin installer更新您的安装:

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

重新安装git也可以:

pact remove git
pact install git

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

pact update git

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

更新后git出现问题:

警告:Git push策略设置为不支持-更改为错误:无法将git push.default设置为'matching' - may导致问题……无法启动插件[git]

但是用下面的命令卸载它之后,它又工作了。

pact remove git

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

尝试使用pact update git更新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

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…但首先我要给Windows Subsystem for Linux一个尝试

wslgit.bat: (on x64 arch)

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

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

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

我的工作电脑没有连接到互联网,所以我通常必须下载完整的安装文件并在传输后运行它们。不可能依赖网络

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

在Babun我运行pact update git,但我知道这当然不会工作,因为我没有连接到互联网。

当我运行pact update git

时发生了这种情况
  1. 协议删除git
  2. 协议抱怨镜像不可用(不奇怪)
  3. 协议放弃

然后我想,既然吉特走了,巴本就完了。

我输入git version,结果是git version 2.21.0.windows.1

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

最新更新