zoukankan      html  css  js  c++  java
  • windows10git升级

     方式一:

    PS C:WINDOWSsystem32> git update
    Warning! `git update` has been deprecated;
    Please use `git update-git-for-windows` instead.
    Git for Windows 2.24.1.windows.2 (64bit)
    Update 2.25.0.windows.1 is available
    Download and install Git for Windows 2.25.0 [N/y]? y
    PS C:WINDOWSsystem32>

     参考

    https://segmentfault.com/q/1010000011704285

    https://stackoverflow.com/questions/13790592/how-to-upgrade-to-the-latest-version-of-git-on-windows-still-showing-older-vers

    https://segmentfault.com/a/1190000004317077

    方式二:

    https://chocolatey.org/packages/git
    首先安装chocolatey,操作步骤请参考https://chocolatey.org/install

    • 以管理员身份运行 CMD或者PowerShell,输入以下命令
      Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
      安装过程如下:
      PS C:Windowssystem32> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
      Getting latest version of the Chocolatey package for download.
      Getting Chocolatey from https://chocolatey.org/api/v2/package/chocolatey/0.10.15.
      Downloading 7-Zip commandline tool prior to extraction.
      Extracting C:Users[UserName]AppDataLocalTempchocolateychocInstallchocolatey.zip to C:Users[UserName]AppDataLocalTempchocolateychocInstall...
      Installing chocolatey on this machine
      Creating ChocolateyInstall as an environment variable (targeting 'Machine')
        Setting ChocolateyInstall to 'C:ProgramDatachocolatey'
      WARNING: It's very likely you will need to close and reopen your shell
        before you can use choco.
      Restricting write permissions to Administrators
      We are setting up the Chocolatey package repository.
      The packages themselves go to 'C:ProgramDatachocolateylib'
        (i.e. C:ProgramDatachocolateylibyourPackageName).
      A shim file for the command line goes to 'C:ProgramDatachocolateyin'
        and points to an executable in 'C:ProgramDatachocolateylibyourPackageName'.
      
      Creating Chocolatey folders if they do not already exist.
      
      WARNING: You can safely ignore errors related to missing log files when
        upgrading from a version of Chocolatey less than 0.9.9.
        'Batch file could not be found' is also safe to ignore.
        'The system cannot find the file specified' - also safe.
      chocolatey.nupkg file not installed in lib.
       Attempting to locate it from bootstrapper.
      PATH environment variable does not have C:ProgramDatachocolateyin in it. Adding...
      警告: Not setting tab completion: Profile file does not exist at
      'D:[UserName]DocumentsWindowsPowerShellMicrosoft.PowerShell_profile.ps1'.
      Chocolatey (choco.exe) is now ready.
      You can call choco from anywhere, command line or powershell by typing choco.
      Run choco /? for a list of functions.
      You may need to shut down and restart powershell and/or consoles
       first prior to using choco.
      Ensuring chocolatey commands are on the path
      Ensuring chocolatey.nupkg is in the lib folder
      PS C:Windowssystem32>
    • 等待执行完成,输入choco /? 或者 choco version验证是否安装成功
      PS C:Windowssystem32> choco version
      Chocolatey v0.10.15
      
      DEPRECATION NOTICE - choco version command is deprecated and will be
       removed in version 1.0.0. Please use `choco upgrade pkgname --noop`
       instead.
      _ Chocolatey:ChocolateyVersionCommand - Noop Mode _
      chocolatey v0.10.15 is the latest version available based on your source(s).
      
      Chocolatey can upgrade 0/1 packages.
       See the log for details (C:ProgramDatachocolateylogschocolatey.log).
      PS C:Windowssystem32>
    • 安装成功后,使用choco命令更新git到最新版本
      PS C:Windowssystem32> choco install -y git

    总结

    方式一:使用的是git-scm官方源,由于官方源文件使用的是亚马逊云的服务器,国内访问非常慢,很难更新成功,如果更新成功真的是拼网络运行商的网了,成败看人品

    方式二:是换Chocolatey的安装源,不过首先要安装Chocolatey命令工具,使用choco命令来更新git到最新版本,
        windows 10 1909 (OS 内部版本 18363.836)已验证,访问速度还是挺快的,推荐

  • 相关阅读:
    微信扫码签到系统asp源码2.0示例
    asp代码写的,微信会员报名转发分享带上下级和邀约人关系并且能微信支付asp编号的
    asp微信支付代码v4.1无需证书版,带回调入库的asp支付源码
    asp微信支付源码完整版下载,带证书文件post_url.aspx和post_url.aspx.cs源码下载
    asp群发微信公众号模板消息代码
    asp生成带参数的二维码并合成推广海报图片,asp合并合成推广海报图片asp代码
    asp微信公众号支付回调参数入库demo详细示例
    asp实现微信jssdk分享,静态页html实现jssdk微信分享
    asp微信支付企业付款功能代码下载
    asp实现微信客服消息群发,asp代码写的
  • 原文地址:https://www.cnblogs.com/codefly/p/windows10_git_update_git_for_windows.html
Copyright © 2011-2022 走看看