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)已验证,访问速度还是挺快的,推荐

  • 相关阅读:
    .NET Core微服务开发服务间调用篇-GRPC
    .NET Core微服务开发网关篇-ocelot
    刷新.NET
    (译)An introduction to Kubernetes
    一文了解Nuget的使用
    .NET Core应用框架AA介绍(二)
    .NET Core 3.0 使用Nswag生成Api文档和客户端代码
    .NET core3.0 使用Jwt保护api
    阅读源码学设计模式-单例模式
    .NET Core 3.0 部署在docker上运行
  • 原文地址:https://www.cnblogs.com/codefly/p/windows10_git_update_git_for_windows.html
Copyright © 2011-2022 走看看