33

爱了!一个现代化的 Git CLI 客户端,一堆命令不用记了

 3 years ago
source link: https://mp.weixin.qq.com/s/sqlUqc17S1myF9ezyScWxA
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

关注公众号 “ 转角遇到GitHub ” ,每天推荐给你优秀开源项目

大家好,我是欧盆索思(opensource),每天为你带来优秀的开源项目!

先看一张动图:

UfMjmy.gif!mobile

今天推荐的这个工具是:bit,它是构建在 git 之上的实验性现代化 git CLI,可提供令人满意的默认值和其他优点。

  • 命令和 flag 建议,以帮助你浏览 git 为您提供的众多选项;

  • bit add、bit checkout 能自动完成分支名和文件名;

  • 自动获取(fetch)和分支快速转发(fast-forwarding),减少合并冲突的可能性;

  • 建议与 git 别名一起使用;

  • 一些新命令,如 bit sync 等,能极大地简化了工作流程;

  • 来自 git-extras 的命令,例如 bit release & bit info;

  • 与 git 完全兼容,允许您在需要时回退到 git。

项目地址:https://github.com/chriswalz/bit,Star 数:2.7k+。这是一个 Go 项目。

安装

1)最简单的安装方式

$ curl -sf https://gobinaries.com/chriswalz/bit | sh; curl -sf https://gobinaries.com/chriswalz/bit/bitcomplete | sh && echo y | COMP_INSTALL=1 bitcomplete
$ bit

2)也可以直接从这里下载

https://github.com/chriswalz/bit/releases

3)如果安装了 Go,则可以从源码编译

确保使用了 go module。

$ go get github.com/chriswalz/bit
$ bit

注意,bit 依赖 git。所以你本地需要安装 git。

目前支持如下平台:

  • iTerm2 (macOS)

  • Terminal.app (macOS)

  • Command Prompt (Windows)

  • WSL/Windows Subsystem for Linux (Windows)

  • gnome-terminal (Ubuntu)

bit 特有的命令

1、bit save [commit message]

创建一个新的提交。

2、bit sync

同步对 origin 分支的更改。

大部分时候,bit sync 相当于 bit commit -m "I can still use git commands" , bit pull -r origin master

bit 常见工作流

通过例子演示 bit 常见工作流。

1、切换分支

$ bit
> bit switch example-branch
? Branch does not exist. Do you want to create it? Yes
Switched to a new branch 'example-branch'

2、做一些改动

$ bit add *
$ bit save "add important feature"

3、做其他改动

$ bit save

4、push 改变到 origin

$ bit sync

5、一段时间后,可以再同步别人的修改

$ bit sync

一般都直接输入 bit,然后回车。接着输入会自动提示,如开始的动图。

文末 「阅读原文」 可直达项目首页。

今天的项目大家觉得怎么样吗?如果你喜欢,请在文章底部留言、点赞或关注转发,你的支持就是我持续更新的最大动力!

推荐阅读

转角遇到GitHub - 送给爱开源的你

EFjiQbu.jpg!mobile

Git · GitHub · GitLab · Gitee


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK