【问题标题】:update git via cmd?通过cmd更新git?
【发布时间】:2019-08-05 09:44:48
【问题描述】:

我最近将我的 Git 扩展更新为 3.0.2.5232,现在我的 git 不再受支持。当我跑步时:

git --version 

我明白了

 git version 2.9.0.windows.1

但是,我不能只在线下载最新版本的 git,因为由于管理员权限,我无法运行 .exe 安装程序等等,那么有没有我可以运行的命令直接从 admin cmd 升级?

【问题讨论】:

    标签: git git-extensions git-for-windows


    【解决方案1】:

    是的。

    在你的 cmd 中使用命令:git update-git-for-windows 并按 Y 并更新它。

    例子:

    PS:我没有任何管理员控制权。这是我公司的电脑,所以你应该也可以更新它

    【讨论】:

    【解决方案2】:

    如果由于正确的限制而无法运行 exe,则应使用便携式版本(https://github.com/git-for-windows/git/releases)。

    将其解压到一个文件夹中,并将该文件夹的路径添加到您的PATH 环境变量之前旧git之一。或者直接在 GitExtensions 中设置。

    【讨论】:

      【解决方案3】:

      下载一个可移植的 git 版本 (https://git-scm.com/download/win),并通过 Settings > Git > Paths 将 GE 指向它

      【讨论】:

        【解决方案4】:

        在你的 git Bash 控制台中使用命令:git update-git-for-windows

        【讨论】:

          【解决方案5】:

          在我的回答中,我将展示如何在 windows、linux、macos 上更新 git

          • First在windows上,打开git命令窗口写

            • git update-git-for-windows

          • Second 在 linux 上,打开终端并编写此命令

            sudo add-apt-repository ppa:git-core/ppa -y

            sudo apt-get update

            sudo apt-get install git -y

          安装后显示 git 版本 git --version


          【讨论】:

            猜你喜欢
            • 2013-01-15
            • 1970-01-01
            • 2012-07-09
            • 2012-01-28
            • 2021-10-08
            • 2015-08-16
            • 1970-01-01
            • 2020-11-19
            • 2018-12-01
            相关资源
            最近更新 更多