Could I extend git functionality in my ~/bin/ directory?

UlfR

As stated in numerous posts like this you could extend git by placing a program/script in your PATH. I get it working if I place my script in for example /usr/local/bin/. But I what to add commands without being root, but if if put it in ~/bin/ it will not be found.

~/bin/ is in my PATH since its added in my .bashrc like this:

export PATH="${PATH}:~/bin"

I got other stuff as well in my ~/bin/ that I use regularly so the PATH-thing is working for other things!

Is there something I'm missing or doing wrong here?

VonC

The only missing piece would be the naming convention:

git my-custom-made-extension ... → git-my-custom-made-extension

That means you need to have an executable file ~/bin/git-my-custom-made-extension (no extension, chmod 755)

Plus, don't rely on ~: the git shell which will execute the script might not have the same ~ as the user who owns the script. PATH should include the full path of the home.

See "Shell variable expansion in git config"

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

error: could not lock config file .git/config: No such file or directory

分類Dev

Should I put my JWT token in the URL for password reset functionality?

分類Dev

Header on my website does not extend to the left and right as I wish

分類Dev

Why can't I extend my desktop 12.04 in KDE?

分類Dev

How do I set path to respective bin of the mingw directory

分類Dev

Can I git push another directory?

分類Dev

What happens to files in the Recycle Bin when I delete my account?

分類Dev

I accidentally deleted my home folder and Trash bin (Ubuntu 12.04)

分類Dev

Why is my Git repository so much bigger than the working directory?

分類Dev

How could I confirm if my server supports hole punching?

分類Dev

Why doesn't my JBoss AS bin directory contain a run.sh script?

分類Dev

How can I bind my capslock key to a fish shell command, and disable its toggle-caps functionality?

分類Dev

Git Status that doesn't go crazy if I'm in the wrong directory

分類Dev

How can I paste "my directory/*.class" to cp?

分類Dev

How do I find current directory for my Batch file?

分類Dev

How can I mount a drive under my home directory at boot?

分類Dev

I can't find my branch in github, that i created on git

分類Dev

How could I write a Perl script to calculate the MD5 sum of every file in a directory?

分類Dev

How to extend my root (/) partition?

分類Dev

Unable to delete the bin directory in Filezilla

分類Dev

Can I git clone into a directory without cloning the project name as a directory (using bitbucket)?

分類Dev

How do I make the directories in a zip file relative to the target directory instead of my working directory

分類Dev

In Unix how would I copy /etc/passwd using relative path to a directory under my home directory?

分類Dev

How to show git log history (i.e., all the related commits) for a sub directory of a git repo?

分類Dev

How to show git log history (i.e., all the related commits) for a sub directory of a git repo?

分類Dev

How to show git log history (i.e., all the related commits) for a sub directory of a git repo?

分類Dev

KDEInit could not launch /usr/bin/kate

分類Dev

I really need to access my files :( from my previous Home directory

分類Dev

Why are folders left in my local git working directory after commit and checkout

Related 関連記事

  1. 1

    error: could not lock config file .git/config: No such file or directory

  2. 2

    Should I put my JWT token in the URL for password reset functionality?

  3. 3

    Header on my website does not extend to the left and right as I wish

  4. 4

    Why can't I extend my desktop 12.04 in KDE?

  5. 5

    How do I set path to respective bin of the mingw directory

  6. 6

    Can I git push another directory?

  7. 7

    What happens to files in the Recycle Bin when I delete my account?

  8. 8

    I accidentally deleted my home folder and Trash bin (Ubuntu 12.04)

  9. 9

    Why is my Git repository so much bigger than the working directory?

  10. 10

    How could I confirm if my server supports hole punching?

  11. 11

    Why doesn't my JBoss AS bin directory contain a run.sh script?

  12. 12

    How can I bind my capslock key to a fish shell command, and disable its toggle-caps functionality?

  13. 13

    Git Status that doesn't go crazy if I'm in the wrong directory

  14. 14

    How can I paste "my directory/*.class" to cp?

  15. 15

    How do I find current directory for my Batch file?

  16. 16

    How can I mount a drive under my home directory at boot?

  17. 17

    I can't find my branch in github, that i created on git

  18. 18

    How could I write a Perl script to calculate the MD5 sum of every file in a directory?

  19. 19

    How to extend my root (/) partition?

  20. 20

    Unable to delete the bin directory in Filezilla

  21. 21

    Can I git clone into a directory without cloning the project name as a directory (using bitbucket)?

  22. 22

    How do I make the directories in a zip file relative to the target directory instead of my working directory

  23. 23

    In Unix how would I copy /etc/passwd using relative path to a directory under my home directory?

  24. 24

    How to show git log history (i.e., all the related commits) for a sub directory of a git repo?

  25. 25

    How to show git log history (i.e., all the related commits) for a sub directory of a git repo?

  26. 26

    How to show git log history (i.e., all the related commits) for a sub directory of a git repo?

  27. 27

    KDEInit could not launch /usr/bin/kate

  28. 28

    I really need to access my files :( from my previous Home directory

  29. 29

    Why are folders left in my local git working directory after commit and checkout

ホットタグ

アーカイブ