Removing git from /usr/bin












11















I'm on OS X 10.8 and I'm using Homebrew. brew doctor tells me that I have 2 git installations, one in /usr/bin and the other one in /usr/local/bin.



Is it a bad idea to remove git from /usr/bin? If no, what's the best way to remove git and the following components from /usr/bin to only use Homebrew's?



git
git-cvsserver
git-receive-pack
git-shell
git-upload-archive
git-upload-pack
gitk









share|improve this question



























    11















    I'm on OS X 10.8 and I'm using Homebrew. brew doctor tells me that I have 2 git installations, one in /usr/bin and the other one in /usr/local/bin.



    Is it a bad idea to remove git from /usr/bin? If no, what's the best way to remove git and the following components from /usr/bin to only use Homebrew's?



    git
    git-cvsserver
    git-receive-pack
    git-shell
    git-upload-archive
    git-upload-pack
    gitk









    share|improve this question

























      11












      11








      11


      2






      I'm on OS X 10.8 and I'm using Homebrew. brew doctor tells me that I have 2 git installations, one in /usr/bin and the other one in /usr/local/bin.



      Is it a bad idea to remove git from /usr/bin? If no, what's the best way to remove git and the following components from /usr/bin to only use Homebrew's?



      git
      git-cvsserver
      git-receive-pack
      git-shell
      git-upload-archive
      git-upload-pack
      gitk









      share|improve this question














      I'm on OS X 10.8 and I'm using Homebrew. brew doctor tells me that I have 2 git installations, one in /usr/bin and the other one in /usr/local/bin.



      Is it a bad idea to remove git from /usr/bin? If no, what's the best way to remove git and the following components from /usr/bin to only use Homebrew's?



      git
      git-cvsserver
      git-receive-pack
      git-shell
      git-upload-archive
      git-upload-pack
      gitk






      macos mac git homebrew






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 28 '12 at 11:21









      TillTill

      185127




      185127






















          5 Answers
          5






          active

          oldest

          votes


















          12















          What's the best way to remove git and the following components from /usr/bin to only use Homebrew's?




          Your shell uses the non-Homebrew binaries only because they come first in your $PATH.



          So, in your ~/.bash_profile (or ~/.profile, depending on which you use), add the following line:



          export PATH=/usr/local/bin:$PATH


          Remove all other PATH assignments that would put /usr/local/bin after $PATH, because then, /usr/bin would come first, and your shell would use the system git.





          You could remove the Git installations in /usr/bin, but it's up to which one to choose. I believe at some point you used the git-osx-installer, which put it there, but there's no problem keeping both installations. You just have to know which one you want to use.






          share|improve this answer































            0














            Apply common sense and ask yourself WHY do you want one install removed? Do you want to invoke one of those two gits everytime? Just have its bin directory in PATH first.






            share|improve this answer































              0














              The best way is to remove it using Homebrew, because it has the record that your git was installed. If you remove it manually, during some repair process, it could install it again.



              With following command check what files git package is using:



              brew info --all git


              Or all the files with dependencies:



              brew ls --unbrewed git


              The the simple way is to remove it by:



              brew remove git


              But it's up to you.
              If the git was installed by different package manager, try that one which you installed with (like port, etc.).






              share|improve this answer


























              • I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                – slhck
                Jul 28 '12 at 16:50






              • 1





                The presence of git in /usr/bin points to it being a non-Homebrew installation.

                – echristopherson
                Jul 28 '12 at 23:45











              • I'm using brew with sudo, but it depends of your configuration.

                – kenorb
                Jul 29 '12 at 0:31



















              0














              Because of the "/usr/bin/git" is installed by apple git-48, so I prefer DO NOT change the PATH.
              You could do something like following:




              $ brew update

              $ brew install

              $ sudo mv /usr/bin/git /usr/bin/git-48




              Then you can check it by




              $ git --version




              The output will be like this:
              git version 2.1.0



              BTW, if you want to install vim by homebrew, it also works.






              share|improve this answer































                0















                How to remove the git installation from /usr/local/bin on a Mac.
                (OSX 10.14.2)




                I had an old 1.9.0 git installation from an git-osx-installer package (git-1.9.0-intel-universal-snow-leopard.dmg). Here's how I removed it.



                Fist, find your git version and install location.



                $ which git
                /usr/local/git/bin/git
                $ git --version
                git version 1.9.0


                Then, find your original git installer package, in my case git-1.9.0-intel-universal-snow-leopard.dmg. If you don't have it download from here: https://sourceforge.net/projects/git-osx-installer/files/



                Finally, open the installer package (git-1.9.0-intel-universal-snow-leopard.dmg), and run uninstall.sh file in the root folder.



                $ uninstall.sh


                DONE



                Attaching the uninstall.sh file, which shows the file paths being deleted. The uninstall script may be different for different installer versions, so be sure to use the correct one.



                uninstall.sh file (git-1.9.0-intel-universal-snow-leopard.dmg)



                if [ ! -r "/usr/local/git" ]; then
                echo "Git doesn't appear to be installed via this installer. Aborting"
                exit 1
                fi
                echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
                printf "Type 'yes' if you sure you wish to continue: "
                read response
                if [ "$response" == "yes" ]; then
                sudo rm -rf /usr/local/git/
                sudo rm /etc/paths.d/git
                sudo rm /etc/manpaths.d/git
                pkgutil --packages | grep GitOSX.Installer | xargs -I {} sudo pkgutil --forget {}
                echo "Uninstalled"
                else
                echo "Aborted"
                exit 1
                fi

                exit 0





                share|improve this answer























                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "3"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f454694%2fremoving-git-from-usr-bin%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  5 Answers
                  5






                  active

                  oldest

                  votes








                  5 Answers
                  5






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  12















                  What's the best way to remove git and the following components from /usr/bin to only use Homebrew's?




                  Your shell uses the non-Homebrew binaries only because they come first in your $PATH.



                  So, in your ~/.bash_profile (or ~/.profile, depending on which you use), add the following line:



                  export PATH=/usr/local/bin:$PATH


                  Remove all other PATH assignments that would put /usr/local/bin after $PATH, because then, /usr/bin would come first, and your shell would use the system git.





                  You could remove the Git installations in /usr/bin, but it's up to which one to choose. I believe at some point you used the git-osx-installer, which put it there, but there's no problem keeping both installations. You just have to know which one you want to use.






                  share|improve this answer




























                    12















                    What's the best way to remove git and the following components from /usr/bin to only use Homebrew's?




                    Your shell uses the non-Homebrew binaries only because they come first in your $PATH.



                    So, in your ~/.bash_profile (or ~/.profile, depending on which you use), add the following line:



                    export PATH=/usr/local/bin:$PATH


                    Remove all other PATH assignments that would put /usr/local/bin after $PATH, because then, /usr/bin would come first, and your shell would use the system git.





                    You could remove the Git installations in /usr/bin, but it's up to which one to choose. I believe at some point you used the git-osx-installer, which put it there, but there's no problem keeping both installations. You just have to know which one you want to use.






                    share|improve this answer


























                      12












                      12








                      12








                      What's the best way to remove git and the following components from /usr/bin to only use Homebrew's?




                      Your shell uses the non-Homebrew binaries only because they come first in your $PATH.



                      So, in your ~/.bash_profile (or ~/.profile, depending on which you use), add the following line:



                      export PATH=/usr/local/bin:$PATH


                      Remove all other PATH assignments that would put /usr/local/bin after $PATH, because then, /usr/bin would come first, and your shell would use the system git.





                      You could remove the Git installations in /usr/bin, but it's up to which one to choose. I believe at some point you used the git-osx-installer, which put it there, but there's no problem keeping both installations. You just have to know which one you want to use.






                      share|improve this answer














                      What's the best way to remove git and the following components from /usr/bin to only use Homebrew's?




                      Your shell uses the non-Homebrew binaries only because they come first in your $PATH.



                      So, in your ~/.bash_profile (or ~/.profile, depending on which you use), add the following line:



                      export PATH=/usr/local/bin:$PATH


                      Remove all other PATH assignments that would put /usr/local/bin after $PATH, because then, /usr/bin would come first, and your shell would use the system git.





                      You could remove the Git installations in /usr/bin, but it's up to which one to choose. I believe at some point you used the git-osx-installer, which put it there, but there's no problem keeping both installations. You just have to know which one you want to use.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jul 28 '12 at 16:44









                      slhckslhck

                      160k47444466




                      160k47444466

























                          0














                          Apply common sense and ask yourself WHY do you want one install removed? Do you want to invoke one of those two gits everytime? Just have its bin directory in PATH first.






                          share|improve this answer




























                            0














                            Apply common sense and ask yourself WHY do you want one install removed? Do you want to invoke one of those two gits everytime? Just have its bin directory in PATH first.






                            share|improve this answer


























                              0












                              0








                              0







                              Apply common sense and ask yourself WHY do you want one install removed? Do you want to invoke one of those two gits everytime? Just have its bin directory in PATH first.






                              share|improve this answer













                              Apply common sense and ask yourself WHY do you want one install removed? Do you want to invoke one of those two gits everytime? Just have its bin directory in PATH first.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jul 28 '12 at 13:39









                              AnonymousLurkerAnonymousLurker

                              5451616




                              5451616























                                  0














                                  The best way is to remove it using Homebrew, because it has the record that your git was installed. If you remove it manually, during some repair process, it could install it again.



                                  With following command check what files git package is using:



                                  brew info --all git


                                  Or all the files with dependencies:



                                  brew ls --unbrewed git


                                  The the simple way is to remove it by:



                                  brew remove git


                                  But it's up to you.
                                  If the git was installed by different package manager, try that one which you installed with (like port, etc.).






                                  share|improve this answer


























                                  • I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                                    – slhck
                                    Jul 28 '12 at 16:50






                                  • 1





                                    The presence of git in /usr/bin points to it being a non-Homebrew installation.

                                    – echristopherson
                                    Jul 28 '12 at 23:45











                                  • I'm using brew with sudo, but it depends of your configuration.

                                    – kenorb
                                    Jul 29 '12 at 0:31
















                                  0














                                  The best way is to remove it using Homebrew, because it has the record that your git was installed. If you remove it manually, during some repair process, it could install it again.



                                  With following command check what files git package is using:



                                  brew info --all git


                                  Or all the files with dependencies:



                                  brew ls --unbrewed git


                                  The the simple way is to remove it by:



                                  brew remove git


                                  But it's up to you.
                                  If the git was installed by different package manager, try that one which you installed with (like port, etc.).






                                  share|improve this answer


























                                  • I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                                    – slhck
                                    Jul 28 '12 at 16:50






                                  • 1





                                    The presence of git in /usr/bin points to it being a non-Homebrew installation.

                                    – echristopherson
                                    Jul 28 '12 at 23:45











                                  • I'm using brew with sudo, but it depends of your configuration.

                                    – kenorb
                                    Jul 29 '12 at 0:31














                                  0












                                  0








                                  0







                                  The best way is to remove it using Homebrew, because it has the record that your git was installed. If you remove it manually, during some repair process, it could install it again.



                                  With following command check what files git package is using:



                                  brew info --all git


                                  Or all the files with dependencies:



                                  brew ls --unbrewed git


                                  The the simple way is to remove it by:



                                  brew remove git


                                  But it's up to you.
                                  If the git was installed by different package manager, try that one which you installed with (like port, etc.).






                                  share|improve this answer















                                  The best way is to remove it using Homebrew, because it has the record that your git was installed. If you remove it manually, during some repair process, it could install it again.



                                  With following command check what files git package is using:



                                  brew info --all git


                                  Or all the files with dependencies:



                                  brew ls --unbrewed git


                                  The the simple way is to remove it by:



                                  brew remove git


                                  But it's up to you.
                                  If the git was installed by different package manager, try that one which you installed with (like port, etc.).







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Jul 29 '12 at 0:30

























                                  answered Jul 28 '12 at 12:29









                                  kenorbkenorb

                                  10.9k1578114




                                  10.9k1578114













                                  • I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                                    – slhck
                                    Jul 28 '12 at 16:50






                                  • 1





                                    The presence of git in /usr/bin points to it being a non-Homebrew installation.

                                    – echristopherson
                                    Jul 28 '12 at 23:45











                                  • I'm using brew with sudo, but it depends of your configuration.

                                    – kenorb
                                    Jul 29 '12 at 0:31



















                                  • I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                                    – slhck
                                    Jul 28 '12 at 16:50






                                  • 1





                                    The presence of git in /usr/bin points to it being a non-Homebrew installation.

                                    – echristopherson
                                    Jul 28 '12 at 23:45











                                  • I'm using brew with sudo, but it depends of your configuration.

                                    – kenorb
                                    Jul 29 '12 at 0:31

















                                  I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                                  – slhck
                                  Jul 28 '12 at 16:50





                                  I'm afraid Homebrew won't work with sudo – there's no need to run it with root permissions anyway.

                                  – slhck
                                  Jul 28 '12 at 16:50




                                  1




                                  1





                                  The presence of git in /usr/bin points to it being a non-Homebrew installation.

                                  – echristopherson
                                  Jul 28 '12 at 23:45





                                  The presence of git in /usr/bin points to it being a non-Homebrew installation.

                                  – echristopherson
                                  Jul 28 '12 at 23:45













                                  I'm using brew with sudo, but it depends of your configuration.

                                  – kenorb
                                  Jul 29 '12 at 0:31





                                  I'm using brew with sudo, but it depends of your configuration.

                                  – kenorb
                                  Jul 29 '12 at 0:31











                                  0














                                  Because of the "/usr/bin/git" is installed by apple git-48, so I prefer DO NOT change the PATH.
                                  You could do something like following:




                                  $ brew update

                                  $ brew install

                                  $ sudo mv /usr/bin/git /usr/bin/git-48




                                  Then you can check it by




                                  $ git --version




                                  The output will be like this:
                                  git version 2.1.0



                                  BTW, if you want to install vim by homebrew, it also works.






                                  share|improve this answer




























                                    0














                                    Because of the "/usr/bin/git" is installed by apple git-48, so I prefer DO NOT change the PATH.
                                    You could do something like following:




                                    $ brew update

                                    $ brew install

                                    $ sudo mv /usr/bin/git /usr/bin/git-48




                                    Then you can check it by




                                    $ git --version




                                    The output will be like this:
                                    git version 2.1.0



                                    BTW, if you want to install vim by homebrew, it also works.






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      Because of the "/usr/bin/git" is installed by apple git-48, so I prefer DO NOT change the PATH.
                                      You could do something like following:




                                      $ brew update

                                      $ brew install

                                      $ sudo mv /usr/bin/git /usr/bin/git-48




                                      Then you can check it by




                                      $ git --version




                                      The output will be like this:
                                      git version 2.1.0



                                      BTW, if you want to install vim by homebrew, it also works.






                                      share|improve this answer













                                      Because of the "/usr/bin/git" is installed by apple git-48, so I prefer DO NOT change the PATH.
                                      You could do something like following:




                                      $ brew update

                                      $ brew install

                                      $ sudo mv /usr/bin/git /usr/bin/git-48




                                      Then you can check it by




                                      $ git --version




                                      The output will be like this:
                                      git version 2.1.0



                                      BTW, if you want to install vim by homebrew, it also works.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Sep 17 '14 at 9:15









                                      Jayson LP ChenJayson LP Chen

                                      1




                                      1























                                          0















                                          How to remove the git installation from /usr/local/bin on a Mac.
                                          (OSX 10.14.2)




                                          I had an old 1.9.0 git installation from an git-osx-installer package (git-1.9.0-intel-universal-snow-leopard.dmg). Here's how I removed it.



                                          Fist, find your git version and install location.



                                          $ which git
                                          /usr/local/git/bin/git
                                          $ git --version
                                          git version 1.9.0


                                          Then, find your original git installer package, in my case git-1.9.0-intel-universal-snow-leopard.dmg. If you don't have it download from here: https://sourceforge.net/projects/git-osx-installer/files/



                                          Finally, open the installer package (git-1.9.0-intel-universal-snow-leopard.dmg), and run uninstall.sh file in the root folder.



                                          $ uninstall.sh


                                          DONE



                                          Attaching the uninstall.sh file, which shows the file paths being deleted. The uninstall script may be different for different installer versions, so be sure to use the correct one.



                                          uninstall.sh file (git-1.9.0-intel-universal-snow-leopard.dmg)



                                          if [ ! -r "/usr/local/git" ]; then
                                          echo "Git doesn't appear to be installed via this installer. Aborting"
                                          exit 1
                                          fi
                                          echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
                                          printf "Type 'yes' if you sure you wish to continue: "
                                          read response
                                          if [ "$response" == "yes" ]; then
                                          sudo rm -rf /usr/local/git/
                                          sudo rm /etc/paths.d/git
                                          sudo rm /etc/manpaths.d/git
                                          pkgutil --packages | grep GitOSX.Installer | xargs -I {} sudo pkgutil --forget {}
                                          echo "Uninstalled"
                                          else
                                          echo "Aborted"
                                          exit 1
                                          fi

                                          exit 0





                                          share|improve this answer




























                                            0















                                            How to remove the git installation from /usr/local/bin on a Mac.
                                            (OSX 10.14.2)




                                            I had an old 1.9.0 git installation from an git-osx-installer package (git-1.9.0-intel-universal-snow-leopard.dmg). Here's how I removed it.



                                            Fist, find your git version and install location.



                                            $ which git
                                            /usr/local/git/bin/git
                                            $ git --version
                                            git version 1.9.0


                                            Then, find your original git installer package, in my case git-1.9.0-intel-universal-snow-leopard.dmg. If you don't have it download from here: https://sourceforge.net/projects/git-osx-installer/files/



                                            Finally, open the installer package (git-1.9.0-intel-universal-snow-leopard.dmg), and run uninstall.sh file in the root folder.



                                            $ uninstall.sh


                                            DONE



                                            Attaching the uninstall.sh file, which shows the file paths being deleted. The uninstall script may be different for different installer versions, so be sure to use the correct one.



                                            uninstall.sh file (git-1.9.0-intel-universal-snow-leopard.dmg)



                                            if [ ! -r "/usr/local/git" ]; then
                                            echo "Git doesn't appear to be installed via this installer. Aborting"
                                            exit 1
                                            fi
                                            echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
                                            printf "Type 'yes' if you sure you wish to continue: "
                                            read response
                                            if [ "$response" == "yes" ]; then
                                            sudo rm -rf /usr/local/git/
                                            sudo rm /etc/paths.d/git
                                            sudo rm /etc/manpaths.d/git
                                            pkgutil --packages | grep GitOSX.Installer | xargs -I {} sudo pkgutil --forget {}
                                            echo "Uninstalled"
                                            else
                                            echo "Aborted"
                                            exit 1
                                            fi

                                            exit 0





                                            share|improve this answer


























                                              0












                                              0








                                              0








                                              How to remove the git installation from /usr/local/bin on a Mac.
                                              (OSX 10.14.2)




                                              I had an old 1.9.0 git installation from an git-osx-installer package (git-1.9.0-intel-universal-snow-leopard.dmg). Here's how I removed it.



                                              Fist, find your git version and install location.



                                              $ which git
                                              /usr/local/git/bin/git
                                              $ git --version
                                              git version 1.9.0


                                              Then, find your original git installer package, in my case git-1.9.0-intel-universal-snow-leopard.dmg. If you don't have it download from here: https://sourceforge.net/projects/git-osx-installer/files/



                                              Finally, open the installer package (git-1.9.0-intel-universal-snow-leopard.dmg), and run uninstall.sh file in the root folder.



                                              $ uninstall.sh


                                              DONE



                                              Attaching the uninstall.sh file, which shows the file paths being deleted. The uninstall script may be different for different installer versions, so be sure to use the correct one.



                                              uninstall.sh file (git-1.9.0-intel-universal-snow-leopard.dmg)



                                              if [ ! -r "/usr/local/git" ]; then
                                              echo "Git doesn't appear to be installed via this installer. Aborting"
                                              exit 1
                                              fi
                                              echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
                                              printf "Type 'yes' if you sure you wish to continue: "
                                              read response
                                              if [ "$response" == "yes" ]; then
                                              sudo rm -rf /usr/local/git/
                                              sudo rm /etc/paths.d/git
                                              sudo rm /etc/manpaths.d/git
                                              pkgutil --packages | grep GitOSX.Installer | xargs -I {} sudo pkgutil --forget {}
                                              echo "Uninstalled"
                                              else
                                              echo "Aborted"
                                              exit 1
                                              fi

                                              exit 0





                                              share|improve this answer














                                              How to remove the git installation from /usr/local/bin on a Mac.
                                              (OSX 10.14.2)




                                              I had an old 1.9.0 git installation from an git-osx-installer package (git-1.9.0-intel-universal-snow-leopard.dmg). Here's how I removed it.



                                              Fist, find your git version and install location.



                                              $ which git
                                              /usr/local/git/bin/git
                                              $ git --version
                                              git version 1.9.0


                                              Then, find your original git installer package, in my case git-1.9.0-intel-universal-snow-leopard.dmg. If you don't have it download from here: https://sourceforge.net/projects/git-osx-installer/files/



                                              Finally, open the installer package (git-1.9.0-intel-universal-snow-leopard.dmg), and run uninstall.sh file in the root folder.



                                              $ uninstall.sh


                                              DONE



                                              Attaching the uninstall.sh file, which shows the file paths being deleted. The uninstall script may be different for different installer versions, so be sure to use the correct one.



                                              uninstall.sh file (git-1.9.0-intel-universal-snow-leopard.dmg)



                                              if [ ! -r "/usr/local/git" ]; then
                                              echo "Git doesn't appear to be installed via this installer. Aborting"
                                              exit 1
                                              fi
                                              echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
                                              printf "Type 'yes' if you sure you wish to continue: "
                                              read response
                                              if [ "$response" == "yes" ]; then
                                              sudo rm -rf /usr/local/git/
                                              sudo rm /etc/paths.d/git
                                              sudo rm /etc/manpaths.d/git
                                              pkgutil --packages | grep GitOSX.Installer | xargs -I {} sudo pkgutil --forget {}
                                              echo "Uninstalled"
                                              else
                                              echo "Aborted"
                                              exit 1
                                              fi

                                              exit 0






                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Jan 8 at 12:08









                                              Peter TarlosPeter Tarlos

                                              1




                                              1






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Super User!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f454694%2fremoving-git-from-usr-bin%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  How do I know what Microsoft account the skydrive app is syncing to?

                                                  When does type information flow backwards in C++?

                                                  Grease: Live!