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
- 使用GitBash從Git遠端倉庫下載程式碼Git
- Git使用問題-win7gitbash下gitpull失敗GitWin7
- GitBash初始目錄的修改Git
- PhpStorm 中使用 gitbash 作為 terminal 終端命令列PHPORMGit命令列
- (轉)Windows下安裝Docker, GitBash環境配置WindowsDockerGit
- Windows終端好難用?試試gitbash吧!WindowsGit
- 修改 Idea 終端 Terminal 為 GitBash 或 CmdIdeaGit
- gitbash PHP執行輸出中文亂編解決方式GitPHP
- gitbash 不支援中文處理(中文字元被轉義)Git字元
- gitbash的gitconfig檔案修改時提示拒絕訪問的解決Git
- laravel使用EasyWeChat 使用Laravel
- 使用FTP限制使用者FTP
- 配置vsftpd匿名使用服務,個人使用者使用以及虛擬使用者使用配置細節!FTP
- Laravel passport 多端使用者使用LaravelPassport
- 使用 CSS 追蹤使用者CSS
- mongodb使用者與角色使用MongoDB
- RecyclerView使用指南(四)—— 使用ItemDecorationView
- RecyclerView使用指南(一)—— 基本使用View
- 使用dwebsocket在Django中使用WebsocketWebDjango
- 限制使用者使用session數Session
- 使用Index提示 強制使用索引Index索引
- ImageJ使用教程(一):開始使用
- winscp使用教程多使用者,winscp使用教程多使用者,教程詳情
- vi/vim使用進階: 在VIM中使用GDB除錯 – 使用vimgdb除錯
- 使用jquery和使用框架的區別jQuery框架
- Docker 使用者操作使用說明Docker
- 儘量使用 useReducer,不要使用 useStateuseReducer
- PyCharm使用技巧(六):Regullar Expressions的使用PyCharmExpress
- 使用Bootstrap tab頁切換的使用boot
- Urllib庫的使用一---基本使用
- 使用PyCharm引入需要使用的包PyCharm
- 使用 JWT 認證使用者身份JWT
- 使用者授權,策略的使用
- 使用普通使用者執行 dockerDocker
- 熟練使用使用jQuery Promise (Deferred)jQueryPromise
- mongoDB使用詳解(在node中使用)MongoDB
- 使用Git管理專案 使用總結Git