在Windows上卸载GIT

6
我过去一年在我的Windows Vista笔记本电脑上安装了各种不同的msysgit版本,包括“msysGit-fullinstall”,“msysGit-netinstall”和“preview installers”。在这段时间内,我还安装/使用了不同的版本。我还在Cygwin软件包中安装了一个GIT二进制文件。由于无法编辑.gitconfig文件,我出了点问题(实际上),因此决定将GIT移除,以便重新安装(这样可以更好地喜欢它)。
我尝试了以下步骤,但仍然无法构建成功,出现错误“Old version git-* commands still remain in bindir”- 当尝试使用网络安装程序时。 - 我通过控制面板的添加/删除程序删除了GIT - 从usr/local/bin中删除了所有GIT文件,以及我能找到的其他所有“git”文件 - 我甚至删除了我的Cygwin环境 - 我当前的% HOME%目录为空
如果我选择通过“预览”或“完整”安装程序进行安装,则可以正常工作,并且我可以使用GIT环境/命令 - 除了我仍然无法编辑.gitconfig文件,并收到错误消息:
“error:could not lock config file .git/config: No such file or directory”
总之,我的GIT Windows环境混乱了,那么我该如何清理它以便重新安装GIT!
谢谢!
3个回答

3

在Windows上手动“卸载”git有两个步骤:

  1. PATH环境变量中删除所有指向bin文件夹的路径。
  2. 删除安装git/Cygwin的文件夹。

完成以上步骤后,您可以从此处下载不需要Cygwin的msysgit进行安装:http://code.google.com/p/msysgit/downloads/list


是的,我已经完成了这些步骤,但随后的“net”、“full”和“preview”安装都会引起问题(如上所述)。谢谢。 - Damo
谢谢Sergey。我在我的PATH环境变量中没有看到任何与“git相关”的内容。 - Damo
那么就继续安装“msysgit”吧。 - Sergey K.
安装吗?不需要。我只是双击下载的文件 "msysGit-fullinstall-1.8.3-preview20130601.exe"。 - Damo
“make --version” 是什么意思? - Sergey K.
显示剩余6条评论

2

以下是我的方法(不需要删除CygWin):

  1. 首先,在Cygwin64终端中输入“git status”来验证Git是否已安装。

现在...运行cygwin-1-7-33\setup-x86_64.exe(或任何其他cygwin版本的setup.exe):

> Install from local directory.
> Took default installation Options:
  * Root Directory: C:\cygwin64
  * Install for: All Users
  * Default Text File Type: DOS
> Local Package Directory:
   ...\cygwin-1-7-33
> Select Packages:
  Leave as is ("+All <-> Install") for most, except for removing the 4 git packages:
    > Scroll down to Devel:
      > Check the Bin column of all packages that start with 'git-' 
        (by clicking the 'New' column) - change from 'Keep' to '**Uninstall**':
        - git: Fast Version Control System - core files
        - git-completion: Fast Version Control System - git bash completion
        - git-gui: Fast Version Control System - git-gui viewer
        - gitk: Fast Version Control System - gitk viewer               
> Create Icons:
  No to icon on destop and start menu. (it's already there)

现在,请在Cygwin64终端中键入“git status”以验证Git未安装:
~/ws> -bash: git: command not found

1

所以我不得不重新安装Cygwin,选择了git包。但是无论如何都不能让msysgit正常工作。最初,所有的git命令都可以使用,但我仍然无法编辑.gitconfig文件。以下步骤解决了这个问题:

  1. mkdir ~/.git
  2. git config --global user.email "damo...@foo.com"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接