gitbash使用
How to add more to Git Bash on Windows
Git for Windows comes bundled with the “Git Bash” terminal which is incredibly handy for unix-like commands on a windows machine.
It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.
The basic idea is that C:\Program Files\Git\mingw64\
is your /
directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git
, the mingw64
in this directory is your root. Find it by using pwd -W
).
If you go to that directory, you will find the typical linux root folder structure (bin
, etc
, lib
and so on).
If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories.
Sometimes the windows binary have funny prefixes, so you should rename the .exe
file to the standard name.
Since bin
is on the PATH, it will be automatically available to Git Bash.
Note: Many interactive utilities, such as python
, ipython
or nano
, will not display properly with Git Bash’s mintty terminal.
Try invoking them with winpty
instead, for example winpty ipython
will work nicely.
The Git-for-Windows team is focused on supporting Git, not a full UNIX shell environment.
If you are interested in more complete package, check my notes on Cygwin or Cmder.
Here are some utilities to add:
Wget
- Download the lastest wget binary for windows from eternallybored (they are available as a zip with documentation, or just an exe)
- If you downloaded the zip, extract all (if windows built in zip utility gives an error, use 7-zip).
- Rename the file
wget64.exe
towget.exe
if necessary. - Move
wget.exe
to yourGit\mingw64\bin\
.
Note: I have noticed some bugs when using Wget on Git Bash to create WARC files. For more complex use of Wget, consider Cygwin instead.
Hugo
Hugo static site generator can be downloaded as a binary and does not have a installer.
Dropping it into your bin
easily adds it to your Git Bash path.
Grab the Windows 64-bit version from the releases page.
Unzip the download, then copy hugo.exe
into your Git\mingw64\bin
directory.
Xpdf
Xpdf is a handy utility for manipulating PDF files.
- Download the windows version “Xpdf tools”.
- Extract zip.
- Copy the contents of
xpdf-tools-win-4.00\bin64\
into yourGit\mingw64\bin\
. - Check the docs to get started with tools such as
pdftotext
andpdftopng
.
make
- Go to ezwinports.
- Download
make-4.1-2-without-guile-w32-bin.zip
(get the version without guile). - Extract zip.
- Copy the contents to your
Git\mingw64\
merging the folders, but do NOT overwrite/replace any existing files.
Nano
As of 2018, recent versions of Git Bash include Nano, so this is unnecessary!
- Download the Nano binary from Nano win32-support page. You just need the
.exe
file, which is namednano-git-0d9a7347243.exe
(as of this writing). - Rename the file to
nano.exe
, and copy to themingw64\bin
directory. - This version of Nano will not work with Git Bash alone, but can be invoked using
winpty
, for example,winpty nano test.txt
.
from: https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058#file-gitbash_windows-md
相關文章
- windows + GitBash + PowerVimWindowsGit
- PhpStorm 中使用 gitbash 作為 terminal 終端命令列PHPORMGit命令列
- 使用GitBash從Git遠端倉庫下載程式碼Git
- GitBash初始目錄的修改Git
- 修改 Idea 終端 Terminal 為 GitBash 或 CmdIdeaGit
- (轉)Windows下安裝Docker, GitBash環境配置WindowsDockerGit
- Windows終端好難用?試試gitbash吧!WindowsGit
- gitbash PHP執行輸出中文亂編解決方式GitPHP
- gitbash的gitconfig檔案修改時提示拒絕訪問的解決Git
- laravel使用EasyWeChat 使用Laravel
- 如何使用使用 HAVING 與 ORDER BY?
- winscp使用教程多使用者,winscp使用教程多使用者,教程詳情
- 配置vsftpd匿名使用服務,個人使用者使用以及虛擬使用者使用配置細節!FTP
- TestContainer使用者使用經驗AI
- ImageJ使用教程(一):開始使用
- Laravel passport 多端使用者使用LaravelPassport
- 使用dwebsocket在Django中使用WebsocketWebDjango
- 使用 CSS 追蹤使用者CSS
- RecyclerView使用指南(四)—— 使用ItemDecorationView
- RecyclerView使用指南(一)—— 基本使用View
- mongodb使用者與角色使用MongoDB
- Urllib庫的使用一---基本使用
- Vivado使用技巧(19):使用Vivado Simulator
- 使用者及使用者組管理使用的練習
- jumpserver 使用者,系統使用者和管理使用者 普通使用者和特權使用者 區別Server
- 22. 使用MySQL之使用檢視MySql
- 24. 使用MySQL之使用遊標MySql
- 使用者組和使用者
- 使用 JWT 認證使用者身份JWT
- Docker 使用者操作使用說明Docker
- 使用PyCharm引入需要使用的包PyCharm
- 使用者授權,策略的使用
- 使用jquery和使用框架的區別jQuery框架
- 儘量使用 useReducer,不要使用 useStateuseReducer
- 2、Spring使用+ioc容器配置使用1Spring
- 使用Bootstrap tab頁切換的使用boot
- PyCharm使用技巧(六):Regullar Expressions的使用PyCharmExpress
- 使用普通使用者執行 dockerDocker