百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

git-smart

> 编程语言
开源

在您 git 工作流程中添加一些智能

443 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

在您 git 工作流程中添加一些智能

git-smart

Adds some additional git commands to add some smarts to your workflow. These commands follow a few guidelines:

  1. It should do the 'right thing' in all situations - an inexperienced git user should be guided away from making simple mistakes.
  2. It should make every attempt to explain to the user what decisions it has made, and why.
  3. All git commands that modify the repository should be shown to the user - hopefully this helps the user eventually learn the underlying git commands, and when they're relevant.

Installing

All you need to do is grab the gem:

gem install git-smart

This will add an executable for each command, e.g. git-smart-pull. You call them using git's simple syntax for custom commands, e.g. git smart-pull. They'll be removed when you uninstall the gem.

You almost certainly want to run this as well, to allow git commands to be output with colour:

bash
git config --global color.ui always

Git normally only colours output when being run from the terminal, not from within scripts like these. This sorts that right out.

Get smart!

There's only three commands at this point, but there'll be more!

smart-pull

Run git smart-pull whenever you would have run git pull. It doesn't take any arguments, it'll use the tracking branch configuration or assume 'origin/same-branch-name'.

In brief, it'll detect the best way to grab the changes from the server and update your local branch, using a git rebase -p if there's no easier way. It'll also stash/pop local changes if need be.

Read what it does in detail: smart-pull

Recommended alias to use: gup

smart-merge

Run git smart-merge when you would have run git merge. This is basically a wrapper around git merge --no-ff, which should have been the default anyway. It also does a stash/pop if required, and reports a bit of helpful output.

Details here: smart-merge

Recommended alias to use: gm

smart-log

Big hat tip to @ben_h for this one - it's an alias to a completely badass git log format that not many people know about.

Details here: smart-log

Recommended alias to use: gl

Contributing to git-smart

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2011 Glen Maddern and Envato Pty Ltd. See LICENSE.txt for further details.

Issues· 24 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言