Removing git from /usr/bin
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
add a comment |
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
add a comment |
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
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
macos mac git homebrew
asked Jul 28 '12 at 11:21
TillTill
185127
185127
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.).
I'm afraid Homebrew won't work withsudo
– 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
add a comment |
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.
add a comment |
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Jul 28 '12 at 16:44
slhckslhck
160k47444466
160k47444466
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jul 28 '12 at 13:39
AnonymousLurkerAnonymousLurker
5451616
5451616
add a comment |
add a comment |
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.).
I'm afraid Homebrew won't work withsudo
– 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
add a comment |
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.).
I'm afraid Homebrew won't work withsudo
– 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
add a comment |
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.).
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.).
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 withsudo
– 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
add a comment |
I'm afraid Homebrew won't work withsudo
– 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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Sep 17 '14 at 9:15
Jayson LP ChenJayson LP Chen
1
1
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Jan 8 at 12:08
Peter TarlosPeter Tarlos
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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