[英]How to upgrade Git in Babun
我剛安裝:
https://github.com/babun/babun
在Windows 8中,但是如何將Git升級到最新版本?
它帶有
{〜}»git --version〜git版本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
使用Cygwin安裝程序更新安裝:
重新安裝git可能也可以:
pact remove git
pact install git
重新安裝更快,但是完整的Cygwin升級更安全,因為所有依賴項也會自動升級。
pact update git
剛剛更新到最新版本的Git 2.5.3。
更新后我遇到了git問題:
警告:設置為不支持的Git推送策略-更改為“匹配”錯誤:無法將git push.default設置為“匹配”-可能會導致問題...無法啟動插件[git]
但是,使用以下命令將其卸載后,它又可以工作了。
pact remove git
我認為現在babun使用git的Windows安裝。
嘗試使用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 ...但是首先,我將嘗試Linux的Windows子系統
wslgit.bat :(在x64上)
@echo off
setlocal enabledelayedexpansion
set command=%*
bash.exe -c 'git %command%'
許多事情是偶然發生的。 這就是其中之一。
我喜歡使用Babun,但是現在停止使用Babun時,我知道git版本將成為一個問題(是v2.1.4)。
我的工作計算機未連接到Internet,因此通常必須下載完整的安裝文件並在傳輸后運行它們。 沒有互聯網依賴性。
我已經安裝了Git-Bash,但是在可以的時候我更喜歡Babun終端。
在Babun內部,我運行了pact update git
但是我當然知道這將無法正常工作,因為我沒有連接到Internet。
這是在我運行pact update git
時發生的
然后我以為Git離開了,那對於Babun來說就是這樣。
我輸入了git version
,那里是git version 2.21.0.windows.1
也許不是每個人的最佳解決方案,但當您已經安裝了Git-Bash並且沒有Internet連接時,它就可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.