如何在 Windows 10 bash 系统中安装 bash-it

如何在 Windows 10 bash 系统中安装 bash-it

我经常使用 git 进行工作,猛烈抨击是一款出色的可视化工具,尤其是在处理分支时。我希望有人知道如何在 Windows 10 bash 环境中安装“bash-it”(或任何类似程序)?

我已经在 Google 上搜索过它,但大多数文章都是关于如何在 Mac 上进行设置的。

我希望安装它以便使用 git 分支变得更容易。

拥有 bash-it 的好处

截屏

答案1

我不清楚您是否遇到了问题,或者是否只是需要指导?

我假设您已在 Windows 上设置了 Bash,可以打开 Bash 窗口。完成此操作后,请确保以管理员权限运行它(位于 C:\Windows\System32\bash.exe)(在文件资源管理器中右键单击 bash 并选择以管理员身份运行;您还可以创建一个快捷方式,然后将其固定到任务栏,每次都会以管理员身份运行 bash)。

一旦完成后,您所需要知道的是,当您尝试运行未安装的程序时,bash 将这样回复:

~/src$ attr
The program 'attr' is currently not installed. You can install it by typing:
sudo apt-get install attr

sudo apt-get install $whatever当您需要未安装的程序时,只需执行此操作(例如)。

下列的说明在 Bash-it GitHub 页面上,我使用 Bash 的方法如下:

~/src $ git clone https://github.com/Bash-it/bash-it.git
Cloning into 'bash-it'...
remote: Counting objects: 6339, done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 6339 (delta 15), reused 6 (delta 6), pack-reused 6304
Receiving objects: 100% (6339/6339), 34.99 MiB | 13.00 MiB/s, done.
Resolving deltas: 100% (2867/2867), done.
Checking connectivity... done.
~/src $ cd bash-it/
trey@MYHOST:~/src/bash-it$ ./install.sh
Installing bash-it
Would you like to keep your .bashrc and append bash-it templates at the end? [y/N]
Your original .bashrc has been backed up to .bashrc.bak
Copied the template .bashrc into ~/.bashrc, edit this file to customize bash-it

Enabling sane defaults

Installation finished successfully! Enjoy bash-it!
To start using it, open a new tab or 'source /home/trey/.bashrc'.

To show the available aliases/completions/plugins, type one of the following:
  bash-it show aliases
  bash-it show completions
  bash-it show plugins

To avoid issues and to keep your shell lean, please enable only features you really want to use.
Enabling everything can lead to issues.
trey@MYHOST:~/src/bash-it$ source ~/.bashrc

 2016-09-28 13:05:47 ☆  MYHOST in ~/src/bash-it
± |master ✓| → bash-it show aliases
Alias               Enabled?  Description
ag                    [ ]     the silver searcher (ag) aliases
ansible               [ ]     ansible abbreviations
apt                   [ ]     Apt and dpkg aliases for Ubuntu and Debian distros.
atom                  [ ]     Atom.io editor abbreviations
bundler               [ ]     ruby bundler
clipboard             [ ]     pbcopy and pbpaste shortcuts to linux
curl                  [ ]     Curl aliases for convenience.
docker-compose        [ ]     docker-compose abbreviations
docker                [ ]     docker abbreviations
emacs                 [ ]     emacs editor
fuck                  [ ]
general               [x]     general aliases
git                   [ ]     common git abbreviations
gitsvn                [ ]     common git-svn abbreviations
heroku                [ ]     heroku task abbreviations
hg                    [ ]     mercurial abbreviations
homebrew-cask         [ ]     homebrew-cask abbreviations
homebrew              [ ]     homebrew abbreviations
jitsu                 [ ]     jitsu task abbreviations
laravel               [ ]     laravel artisan abbreviations
maven                 [ ]     maven abbreviations
npm                   [ ]     common npm abbreviations
osx                   [ ]     osx-specific aliases
phoenix               [ ]     phoenix abbreviations
rails                 [ ]     rails abbreviations
svn                   [ ]     common svn abbreviations
textmate              [ ]     textmate abbreviations
tmux                  [ ]     Tmux terminal multiplexer
todo                  [ ]     todo.txt-cli abbreviations
vagrant               [ ]     vagrant aliases
vim                   [ ]     vim abbreviations

to enable an alias, do:
$ bash-it enable alias  <alias name> [alias name]... -or- $ bash-it enable alias all

to disable an alias, do:
$ bash-it disable alias <alias name> [alias name]... -or- $ bash-it disable alias all

 2016-09-28 13:05:57 ☆  MYHOST in ~/src/bash-it
± |master ✓| → ~

相关内容