Edit a file .bashrc
in your home directory. Interactive shells run the commands in that when they start.
How to make 'non-git' aliases permanent on git bash
質問
I'm scratching my head as to how to make my non-git aliases permanent. I know that, in order to make my git aliases permanent, I simply have to add them to '.gitconfig', e.g.:
[alias]
st = status
ci = commit
br = branch
However, what about non-git.. e.g.
alias codePath='cd /c/code/pathToMyProject'
I have a number of conveniences like this one, which die with the terminal (sadly).
I'm running git bash on windows.
Thanks.
解決
他のヒント
Set command line interface (CLI) alias
TEMPRARY Aliases
Terminal
alias p="pwd"
CMD / webstorm
doskey websync=php bin/console assets:install web --symlink
// no quotes ""
PERMANENT Aliases for
Terminal
step 1.
edit C:\Users\seetpalsingh\AppData\Local\Programs\Git\etc\bash.bashrc
put this at end of this file
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
alias websync="C:/xampp/php/php.exe bin/console assets:install web --symlink"
alias schema-up="C:/xampp/php/php.exe bin/console doctrine:schema:update --force
CMD / webstorm
step 1.
create a file with extension .cmd / .bat
e.g. doskey.cmd
put this code in this .cmd/.bat file
doskey websync=C:\xampp\php\php.exe bin\console assets:install web --symlink
doskey schema-up=C:\xampp\php\php.exe bin\console doctrine:schema:update --force
step 2.
create a link to CMD something like this
cmd.exe /K E:\2015/doskey.cmd
required this is link to your file of alias list
/K E:\2015/doskey.cmd
所属していません StackOverflow