Làm theo các bước sau:
Mở tệp .bashrcđược tìm thấy ở vị tríC:\Users\USERNAME\.bashrc
Nếu tệp .bashrckhông tồn tại, hãy tạo tệp bằng các bước dưới đây:
- Mở Command Prompt và goto
C:\Users\USERNAME\.
- Gõ lệnh
notepad ~/.bashrc
Nó tạo .bashrctệp.
Thêm các lệnh mẫu bên dưới của WP CLI, Git, Grunt & PHPCS, v.v.
# ----------------------
# Git Command Aliases
# ----------------------
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
# ----------------------
# WP CLI
# ----------------------
alias wpthl='wp theme list'
alias wppll='wp plugin list'
Bây giờ bạn có thể sử dụng các lệnh:
ga thay vì git add .
wpthl thay vì wp theme list
Ví dụ. Tôi đã sử dụng wpthlcho lệnh WP CLI wp theme list.
Yum@M MINGW64 /c/xampp/htdocs/dev.test
$ wpthl
+------------------------+----------+-----------+----------+
| name | status | update | version |
+------------------------+----------+-----------+----------+
| twentyeleven | inactive | none | 2.8 |
| twentyfifteen | inactive | none | 2.0 |
| twentyfourteen | inactive | none | 2.2 |
| twentyseventeen | inactive | available | 1.6 |
| twentysixteen | inactive | none | 1.5 |
| twentyten | inactive | none | 2.5 |
| twentythirteen | inactive | none | 2.4 |
| twentytwelve | inactive | none | 2.5 |
Để biết thêm chi tiết, hãy đọc bài viết Phím tắt / bí danh cho các lệnh WP CLI, Git, Grunt & PHPCS cho windows
lskhông phải là một bí danh mặc định, nó là một lệnh.ls.exelà/usr/binđể nóiC:\Program Files\Git\usr\bin\ls.exe. Bạn có thể chạy nó từ mộtcmdhoặcPowerShelldòng lệnh.