标签: bash-it

用部分名称在git中切换分支

如果我在git中有以下分支

1194-qa-server
master
remotes/origin/1178-authentication
remotes/origin/1194-qa-server
remotes/origin/HEAD -> origin/master
remotes/origin/master
Run Code Online (Sandbox Code Playgroud)

我想使用--just--切换到分支,即使需要调用脚本,例如:

switch_branch 1178
Run Code Online (Sandbox Code Playgroud)

并且脚本/解决方案应该执行以下操作

  1. git branch -a(在我的存储库中查找本地和远程的所有分支)
  2. 按给定参数过滤('1178'以上)
  3. 提取git可以使用的分支的名称
  4. 切换到那个分支

在不必手动执行所有这些步骤的情况下,建议的方法是什么?

我正在使用Mac OSX,如果这在这里很重要.

更新 - bash-it(github.com/revans/bash-it)符合我的目的

Welcome to Bash It!

Here is a list of commands you can use to get help screens for specific pieces of Bash it:

  rails-help                  list out all aliases you can use with rails.
  git-help                    list out all aliases you can use with git.
  todo-help                   list out all aliases you can use with todo.txt-cli
  brew-help                   list …
Run Code Online (Sandbox Code Playgroud)

git shell console bash-it

10
推荐指数
2
解决办法
3262
查看次数

用bash-it作为子模块的想家

我正在使用Homesick在Github上维护我的dotfile。除此之外,我还将神话般的bash-it用于常规bash功能和插件。我的dotfile配置保存在一个Github存储库中,作为思乡之城,而我的bash-it分支存储在单独的Github存储库中

当我想设置一台新机器时,我首先需要克隆我的bash-it存储库(git clone ...),然后设置乡愁,并从那里复制我的dotfiles存储库homesick clone nwinkler/dotfiles

有没有一种方法可以简化此操作,即将我的bash-it存储库保留为第二个想家的城堡,或者更好地作为我的dotfiles城堡的子模块?理想情况下,我只需一个命令就可以设置dotfiles castle和bash-it。

我可以(或者应该)利用Git子模块吗?或者,还有更好的方法?

git github dotfiles bash-it

5
推荐指数
0
解决办法
422
查看次数

如何卸载Bash-it?

我还没有为Bash-it做好准备,并希望回到最初的CLI.关于如何删除Bash的任何建议都会很棒.谢谢.

编辑:很想知道我为什么要投票,所以我不会两次犯同样的错误.

macos bash bash-it

3
推荐指数
1
解决办法
6467
查看次数

标签 统计

bash-it ×3

git ×2

bash ×1

console ×1

dotfiles ×1

github ×1

macos ×1

shell ×1