Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gau binary conflict (ohmyzsh git.plugin alias) #8

Closed
v7nc3nz opened this issue Apr 30, 2020 · 20 comments
Closed

gau binary conflict (ohmyzsh git.plugin alias) #8

v7nc3nz opened this issue Apr 30, 2020 · 20 comments

Comments

@v7nc3nz
Copy link

v7nc3nz commented Apr 30, 2020

As gau binary conflict with the gau git inbuild alias
gau stands for git add --update (Also: "git add -u")

@v7nc3nz
Copy link
Author

v7nc3nz commented Apr 30, 2020

when you fire
go get -u github.com/lc/gau
this will clone the directory in our $GOPATH/src/github.com/lc/gau......
and this will install binary in the $GOPATH/bin with the name of gau

This issue will cause name conflict between your binary "gau" and git alias "gau"(git add --update)

so this problem will only resolve by changing your repo to a different name , or we should change the $GOPATH/bin/gau to some another binary name.

@lc
Copy link
Owner

lc commented Apr 30, 2020

Hm, I don't plan on renaming this – where do you see that it's a git alias? As far as I've seen so far it seems to be a user-defined alias, right?

I do see it's defined in the ohmyzsh git plugin:

https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh

@v7nc3nz
Copy link
Author

v7nc3nz commented Apr 30, 2020

Actually now a days most of the users use zsh. so i recommended the above solution.
https://github.com/ohmyzsh/ohmyzsh/wiki/Cheatsheet

@lc
Copy link
Owner

lc commented Apr 30, 2020

@vks2694, I use ohmyzsh as well (didn't have that plugin installed though), so I see how this is problematic

@v7nc3nz v7nc3nz closed this as completed Apr 30, 2020
@lc
Copy link
Owner

lc commented Apr 30, 2020

@vks2694,

This is the first time someone's encountered this problem / opened an issue so far – I don't plan on renaming this right now.

Here's a workaround the issue:

You can download the pre-built binaries from the releases page and then move them into your $PATH with a different name

Ex:

▻ tar xvf gau-linux-amd64.tar
▻ mv gau-linux-amd64 /usr/bin/getallurls

@lc lc reopened this Apr 30, 2020
@lc lc changed the title please change name of the repo gau binary conflict (ohmyzsh git.plugin alias) Apr 30, 2020
@lc lc pinned this issue Apr 30, 2020
@v7nc3nz
Copy link
Author

v7nc3nz commented Apr 30, 2020

yeah , Thanks

@v7nc3nz v7nc3nz closed this as completed Apr 30, 2020
@lc
Copy link
Owner

lc commented Apr 30, 2020

Thanks for flagging this @vks2694, I'm going to pin this and add a note in the README. Should more people encounter this issue I may consider renaming.

@omerxx
Copy link

omerxx commented May 1, 2020

@lc Another obvious as option (as a ohmzsh user and gau) is to unalias gau for git because it's rarely used;
Edit with your favorite editor (that should be Vim :) ) and comment out the alias:

vim ~/.oh-my-zsh/plugins/git/git.plugin.zsh
# alias gau='git add --update'

@lc
Copy link
Owner

lc commented May 1, 2020

@omerxx, yep! Thanks for pointing that out 👍 Once you're in the vim club you can't quit 😉

@raz455
Copy link

raz455 commented May 2, 2020

@lc Another obvious as option (as a ohmzsh user and gau) is to unalias gau for git because it's rarely used;
Edit with your favorite editor (that should be Vim :) ) and comment out the alias:

vim ~/.oh-my-zsh/plugins/git/git.plugin.zsh
# alias gau='git add --update'

A second possible solution is that make an alias for "gau" binary in .zshrc as your wish and use it.

@0x646e78
Copy link

0x646e78 commented Oct 8, 2020

Instead of editing the oh-my-zsh plugin, which could cause problems with git conflicts is to set unalias gau in your .zshrc after the line source $ZSH/oh-my-zsh.sh

I don't use the gau git alias so this has been the simplest for me.

@0xcrypto
Copy link

Can confirm this conflict in oh-my-bash as well.

@alexandrepessoa33
Copy link

Instead of editing the oh-my-zsh plugin, which could cause problems with git conflicts is to set unalias gau in your .zshrc after the line source $ZSH/oh-my-zsh.sh

I don't use the gau git alias so this has been the simplest for me.

Thank you so much, it's working now!

@glaucusec
Copy link

@lc Another obvious as option (as a ohmzsh user and gau) is to unalias gau for git because it's rarely used;
Edit with your favorite editor (that should be Vim :) ) and comment out the alias:

vim ~/.oh-my-zsh/plugins/git/git.plugin.zsh
# alias gau='git add --update'

Thanks man.

@Daniyyell
Copy link

This also affect gf also but just renaming the gau to gauu and gf to gff.

problem solved.

@az0mb13
Copy link

az0mb13 commented Jan 17, 2022

Sadly renaming the gau alias to something else breaks the oh-my-zsh update. It'll ask you to stash your changes.

@Daniyyell
Copy link

Yes

@v7nc3nz
Copy link
Author

v7nc3nz commented Jan 17, 2022

Follow this to avoid conflict
#8 (comment)

@tiklup11
Copy link

tiklup11 commented Jul 7, 2022

I had the same issue with gf by tomnomnom

@DuyMTA
Copy link

DuyMTA commented Jul 13, 2024

Here is another workaround the issue:
when you command:
which gau
and it appear:
gau: aliased to git add --update
then first is find any line in .zshrc configuration file have and delete it
second is using command:
unalias gau
hope you guy understand my bad english XD

Repository owner deleted a comment from iq-rasco Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests