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

Is possible to disable some commands? #442

Closed
yam-liu opened this issue Sep 9, 2015 · 8 comments
Closed

Is possible to disable some commands? #442

yam-liu opened this issue Sep 9, 2015 · 8 comments

Comments

@yam-liu
Copy link

yam-liu commented Sep 9, 2015

I install git-extras from brew.
And I already map git-pr and git-pull-request to my own command. But this overrides mine.
Because I use Stash often instead of Github.
Is there a way to disable some of these, or make my command (alias in ~/.gitconfig) have a high priority?
Or just delete, rename those conflict ones from /usr/local/bin?
Below is my script in git global config file

[alias]
      pull-request = "!f() { git fetch $1 refs/pull-requests/$2/from:pull-requests/$2; }; f"
      pr = "!f() { git pull-request origin $1; git checkout pull-requests/$1; }; f"
@hemanth
Copy link
Collaborator

hemanth commented Sep 9, 2015

Well, not as of now.

We must have a prompt in case of conflicts.

//cc @spacewander

@yam-liu
Copy link
Author

yam-liu commented Sep 9, 2015

Thanks, I just rename these two in /usr/local/bin with a suffix "github", my aliases work now.

@spacewander
Copy link
Collaborator

@hemanth
$(COMMAND) conflicts with an alias, still install it and disable the alias? [y/n]
Is this prompt lucid?

@hemanth
Copy link
Collaborator

hemanth commented Sep 12, 2015

💯

@spacewander
Copy link
Collaborator

@ooopscc
When a conflict with alias detected, #444 will prompt you to solve it.
Though it may not fully meet your requirement, at least it can avoid overriding existed aliases.

@yam-liu
Copy link
Author

yam-liu commented Nov 14, 2015

Thanks.

@perlun
Copy link

perlun commented Mar 31, 2021

Long time no see, but for the record, I also ran into this now. I've been using git-extras for some time (probably a couple of years) and it's working nicely; I appreciate things like rename-branch. Now as I upgraded to Debian Bullseye, git-extras was also updated and I noted today that one of my existing git aliases stopped working:

[alias]
    cp = cherry-pick

I guess I'll have to rm /usr/bin/git-cp for now, but it does feel like a bit of a hack.

If it was possible to somehow make aliases from ~/.gitconfig take precedence over the choices made by git-extras, it would be extremely appreciated.

@apolzon
Copy link

apolzon commented Nov 21, 2023

Long time no see, but for the record, I also ran into this now. I've been using git-extras for some time (probably a couple of years) and it's working nicely; I appreciate things like rename-branch. Now as I upgraded to Debian Bullseye, git-extras was also updated and I noted today that one of my existing git aliases stopped working:

[alias]
    cp = cherry-pick

I guess I'll have to rm /usr/bin/git-cp for now, but it does feel like a bit of a hack.

If it was possible to somehow make aliases from ~/.gitconfig take precedence over the choices made by git-extras, it would be extremely appreciated.

fwiw, I was able to just mv git-cp to git-copy and now git copy works as extra's git cp did, and restores my cp alias to its previous behavior -- I didn't look at their source, but I would guess their plugin just looks for anything in that folder with the git- prefix, so you can effectively rename any of their commands that you want (obviously these changes would get overwritten if you upgrade the plugin)

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

6 participants
@hemanth @apolzon @perlun @yam-liu @spacewander and others