Thursday, April 25, 2024
21
rated 0 times [  21] [ 0]  / answers: 1 / hits: 12757  / 1 Year ago, sun, december 18, 2022, 8:33:31

If I do this:



alias g='git'


I loose all completion rules (i.e. branches and remotes are no longer being automatically completed when I hit TAB after typing, for example g push o).


More From » command-line

 Answers
0

Copying and modifying opportunely from /etc/bash_completion.d/git, add the following lines to your ~/.bashrc:



complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null 
|| complete -o default -o nospace -F _git g

[#43439] Monday, December 19, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainbby

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
2 Years ago
ainbby questions
Thu, Mar 23, 23, 10:26, 1 Year ago
Wed, May 10, 23, 00:10, 1 Year ago
Fri, Apr 15, 22, 10:11, 2 Years ago
;