0

I'm using sublime and would like to set it up so that the Git package 'custom command' function can see and use aliases which I've setup in my ~/.gitconfig, which works from my terminal.

In my .gitconfig I have defined an alias:

....

[alias]
    open = !git-open diff master

...

When I try entering 'open' in to the command entry prompt for the "Git: custom command" I get the following error:

git-open diff master: git-open: command not found
fatal: While expanding alias 'open': 'git-open diff master': No such file or directory

How can I get the correct functionality?

Martyn
  • 16,432
  • 24
  • 71
  • 104
  • I've never seen `git-open` before. Are you defining that as an alias earlier in your configuration? Is it a third-party tool of some kind? – ChrisGPT was on strike Jun 18 '14 at 17:20
  • The ! executes a shell command, I have a shell script on my path called git-open which is executable (similar to https://github.com/freshtonic/gitopen) – Martyn Jun 18 '14 at 17:31
  • So the problem isn't that the alias doesn't work. It's that your `git-open` shell script isn't found by Sublime. Where does it live? – ChrisGPT was on strike Jun 18 '14 at 17:38
  • Yes - this is correct. It lives in a directory which I've added to my PATH variable - it seems that sublime is ignoring this. – Martyn Jun 18 '14 at 19:51
  • Where do you add that directory to your `$PATH`? What OS are you on? – ChrisGPT was on strike Jun 18 '14 at 19:53
  • On OSX - I have a ~/.bashrc file which is a little convoluted but if I add "$PATH:$HOME/path/to/script" to the bottom of my .bashrc and close&open sublimetext it still doesn't work – Martyn Jun 18 '14 at 20:05
  • I've heard that OSX is tricksy with its environment variables. Perhaps this will help? http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x – ChrisGPT was on strike Jun 18 '14 at 20:16

0 Answers0