Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstalling GIT on windows

I have had various msysgit installs on my windows vista laptop over the past year, using the "msysGit-fullinstall", "msysGit-netinstall" and "preview installers. Also, installed / used different versions along the way. I also had a GIT binary installed as part of my Cygwin package. I screwed up along the way (actually, I could not edit .gitconfig anymore), and decided to go nuclear and remove GIT to allow me the have a fresh install (which I can love a bit more :) ).

I tried the below steps, but still the build fails with the error "Old version git-* commands still remain in bindir" - when attempting to use the net installer. - I removed GIT through Add / Remove programs in control - Removed all GIT files from usr/local/bin - and every other "git" file I could find - I even removed my Cygwin enviorment - My current %HOME% directory is empty

If I chose to install via the "preview" or "full" installers, it works, can I can use the GIT env / commands - except I again cannot edit the .gitconfig file, and get the error message:

"error: could not lock config file .git/config: No such file or directory"

In summary, I have a botched GIT windows env, so how can I clean it such that I can reinstall GIT!

Thanks.

like image 645
Damo Avatar asked Jul 17 '13 14:07

Damo


People also ask

How do I completely remove Git from Windows?

Open Control Panel. For more information, see Where is Control Panel? in Windows Help. Under "Programs", click Uninstall a program. Right-click the entry named GitHub Desktop, then click Uninstall.

Do I have Git for Windows installed?

You can check whether Git is installed and what version you are using by opening up a terminal window in Linux or Mac, or a command prompt window in Windows, and typing the following command: git --version.


2 Answers

There are two steps that you have to do to manually "uninstall" git on Windows:

  1. You have to remove all paths to your bin folders from your PATH environment variable
  2. Remove folder where your git/Cygwin are installed.

After that you can install Cygwin-less msysgit from here: http://code.google.com/p/msysgit/downloads/list

like image 150
Sergey K. Avatar answered Sep 21 '22 22:09

Sergey K.


Here is my approach to this (without removing CygWin):

  1. first, verify Git is installed by typing 'git status' from Cygwin64 Terminal.

Now... Run cygwin-1-7-33\setup-x86_64.exe (or any other cygwin version's 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)

Now, verify Git is NOT installed by typing 'git status' from Cygwin64 Terminal:

~/ws> -bash: git: command not found
like image 38
WebViewer Avatar answered Sep 22 '22 22:09

WebViewer