{"id":13685939,"url":"https://github.com/scmbreeze/scm_breeze","last_synced_at":"2025-05-14T20:09:03.227Z","repository":{"id":38897790,"uuid":"2606253","full_name":"scmbreeze/scm_breeze","owner":"scmbreeze","description":"Adds numbered shortcuts to the output git status, and much more","archived":false,"fork":false,"pushed_at":"2025-03-01T21:23:44.000Z","size":803,"stargazers_count":2851,"open_issues_count":59,"forks_count":193,"subscribers_count":36,"default_branch":"main","last_synced_at":"2025-04-10T11:02:38.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scmbreeze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-10-19T13:51:49.000Z","updated_at":"2025-04-02T13:43:40.000Z","dependencies_parsed_at":"2024-01-25T05:29:29.983Z","dependency_job_id":"8aecd0e6-2ef8-46c9-99ef-0583f36f7593","html_url":"https://github.com/scmbreeze/scm_breeze","commit_stats":{"total_commits":561,"total_committers":77,"mean_commits":7.285714285714286,"dds":0.3975044563279857,"last_synced_commit":"e606623b71464cdf23ca88f9dd5459fd0f20a299"},"previous_names":["ndbroadbent/scm_breeze"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmbreeze%2Fscm_breeze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmbreeze%2Fscm_breeze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmbreeze%2Fscm_breeze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scmbreeze%2Fscm_breeze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scmbreeze","download_url":"https://codeload.github.com/scmbreeze/scm_breeze/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254219373,"owners_count":22034397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T14:00:59.564Z","updated_at":"2025-05-14T20:09:03.220Z","avatar_url":"https://github.com/scmbreeze.png","language":"Shell","funding_links":[],"categories":["Shell","开发者工具","Developer Tools","Useful Command Line Tools","🛠️ Developer Tools"],"sub_categories":["开发者实用工具","Developer Utilities"],"readme":"\u003cimg src=\"https://user-images.githubusercontent.com/139536/30827652-08e9b684-a265-11e7-95fb-50cbd2fb7c0d.png\" width=\"200\" height=\"200\"\u003e\n\n# SCM Breeze\n\n![master branch](https://github.com/scmbreeze/scm_breeze/actions/workflows/test.yml/badge.svg)\n\n\u003e Streamline your SCM workflow.\n\n**SCM Breeze** is a set of shell scripts (for `bash` and `zsh`) that enhance\nyour interaction with git. It integrates with your shell to give you numbered\nfile shortcuts, a repository index with tab completion, and many other useful\nfeatures.\n\n- [SCM Breeze](#scm-breeze)\n  - [Installation](#installation)\n    - [File Shortcuts](#file-shortcuts)\n      - [Git Status Shortcuts:](#git-status-shortcuts)\n      - ['ls' shortcuts:](#ls-shortcuts)\n      - [Other shortcuts](#other-shortcuts)\n    - [Keyboard bindings](#keyboard-bindings)\n    - [Repository Index](#repository-index)\n    - [Linking External Project Design Directories](#linking-external-project-design-directories)\n      - [1) Create and configure a root design directory](#1-create-and-configure-a-root-design-directory)\n      - [2) Initialize design directories for your projects](#2-initialize-design-directories-for-your-projects)\n      - [3) Link existing design directories into your projects](#3-link-existing-design-directories-into-your-projects)\n  - [Configuration](#configuration)\n    - [1) Configure and use the provided SCM Breeze aliases](#1-configure-and-use-the-provided-scm-breeze-aliases)\n    - [2) Use your own aliases](#2-use-your-own-aliases)\n  - [Custom emojis for username and \"staff\" group](#custom-emojis-for-username-and-staff-group)\n  - [Notes about Tab Completion for Aliases](#notes-about-tab-completion-for-aliases)\n    - [Bash](#bash)\n    - [Zsh](#zsh)\n  - [Updating](#updating)\n  - [Uninstalling](#uninstalling)\n  - [Contributing](#contributing)\n  - [Alternative Projects](#alternative-projects)\n\n## Installation\n\n```bash\ngit clone https://github.com/scmbreeze/scm_breeze.git ~/.scm_breeze\n~/.scm_breeze/install.sh\nsource ~/.bashrc   # or source \"${ZDOTDIR:-$HOME}/.zshrc\"\n```\n\nThe install script creates required default configs and adds the following line\nto your `.bashrc` or `.zshrc`:\n\n`[ -s \"$HOME/.scm_breeze/scm_breeze.sh\" ] \u0026\u0026 source \"$HOME/.scm_breeze/scm_breeze.sh\"`\n\n**Note:** You need to install ruby for some SCM Breeze commands to work. This also improves performance. See [ruby-lang.org](https://www.ruby-lang.org/en/documentation/installation/) for installation information.\n\n### File Shortcuts\n\nSCM Breeze makes it really easy to work with changed files, and groups of\nchanged files. Whenever you view your SCM status, each modified path is stored\nin a numbered environment variable. You can configure the variable prefix,\nwhich is 'e' by default.\n\n#### Git Status Shortcuts:\n\n\u003cdiv class=\"centered\"\u003e\n\u003cimg src=\"http://madebynathan.com/content/images/posts/2011/10/status_with_shortcuts-resized-post.png\" width=\"590\" alt=\"Git Status With Shortcuts\" /\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n#### 'ls' shortcuts:\n\n\u003cdiv class=\"centered\"\u003e\n\u003cimg src=\"http://i.imgur.com/72GE1.png\" alt=\"Ls With Shortcuts\" /\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\nThese numbers (or ranges of numbers) can be used with any SCM or system\ncommand.\n\nFor example, if `ga` was your alias for `git add`, instead of typing something\nlike:\n\n```bash\n$ ga assets/git_breeze/config* assets/git_breeze/install.sh\n```\n\nYou can type this instead:\n\n```bash\n$ ga $e2 $e3 $e11\n```\n\nBut SCM Breeze aliases `ga` to the `git_add_shortcuts` function, which is smart\nenough to expand integers and ranges, so all you need to type is:\n\n```bash\n$ ga 2 3 11\n```\n\nAnd if you want to add all unstaged changes (files 1 to 10):\n\n```bash\n$ ga 1-10\n```\n\n(Note that `ga` will also remove deleted files, unlike the standard `git add`\ncommand. This behavior can be turned off if you don't like it.)\n\nYou can also diff, reset or checkout a file by typing:\n\n```bash\n$ gd 3\n$ grs 4\n$ gco 5\n```\n\nYou can use these shortcuts with system commands by passing your command\nthrough `exec_scmb_expand_args` (default alias is `ge`):\n\n```bash\n$ echo $e4\n# =\u003e assets/git_breeze/git_breeze.sh\n$ ge echo 4\n# =\u003e assets/git_breeze/git_breeze.sh\n$ ge echo 1-3\n# expands to echo $e1 $e2 $e3\n# =\u003e _shared.sh assets/git_breeze/config.example.sh assets/git_breeze/config.sh\n```\n\n#### Other shortcuts\n\nSCM Breeze adds a number of aliases to your shell. Use `list_aliases` to view\nall the aliases and their corresponding commands. You can filter aliases by\nadding a search string: `list_aliases git log`\n\nThere's also a `git_aliases` command, which just shows aliases for `git`\ncommands. You can also pass in additional filters, e.g. `git_aliases log`.\n\n### Keyboard bindings\n\nSome of my most common git commands are `git add` and `git commit`, so I wanted\nthese to be as streamlined as possible. One way of speeding up commonly used\ncommands is by binding them to keyboard shortcuts.\n\nHere are the default key bindings:\n\n- `CTRL`+`x` `c` =\u003e `git_add_and_commit` - add given files (if any), then commit staged changes\n- `CTRL`+`x` `SPACE` =\u003e `git_commit_all` - commit everything\n\nThe commit shortcuts use the `git_commit_prompt` function, which gives a simple\nprompt like this:\n\n\u003cdiv class=\"centered\"\u003e \u003cimg\nsrc=\"http://madebynathan.com/content/images/posts/2011/10/git_commit_all-resized-post.png\"\nalt=\"Git Commit All\" /\u003e \u003c/div\u003e \u003cbr/\u003e (When using bash, this commit prompt gives\nyou access to your bash history via the arrow keys.) \u003cbr/\u003e\n\nAnd if you really want to speed up your workflow, you can type this:\n\n```bash\n$ 2 3 \u003cCTRL+x c\u003e\n```\n\nThis sends the `HOME` key, followed by `git_add_and_commit`:\n\n\u003cdiv class=\"centered\"\u003e\n\u003cimg src=\"http://madebynathan.com/content/images/posts/2011/10/git_add_and_commit_params-resized-post.png\" alt=\"Git Add And Commit\" /\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n### Repository Index\n\nThe second feature is a repository index for all of your projects and\nsubmodules. This gives you super-fast switching between your project\ndirectories, with tab completion, and it can even tab-complete down to project\nsubdirectories. This means that you can keep your projects organized in\nsubfolders, but switch between them as easily as if they were all in one\nfolder.\n\nIt's similar to [autojump](https://github.com/joelthelion/autojump), but it\ndoesn't need to 'learn' anything, and it can do SCM-specific stuff like:\n\n- Running a command for all of your repos (useful if you ever need to update a\n  lot of remote URLs)\n- Update all of your repositories via a cron task\n\nThe default alias for `git_index` is 'c', which might stand for 'code'\n\nYou will first need to configure your repository directory by setting `GIT_REPO_DIR` in `~/.git.scmbrc`.\n\nThen, build the index:\n\n```bash\n$ c --rebuild\n# =\u003e == Scanning /home/ndbroadbent/code for git repos \u0026 submodules...\n# =\u003e ===== Indexed 64 repos in /home/ndbroadbent/code/.git_index\n```\n\nThen you'll be able to switch between your projects, or show the list of\nindexed repos.\n\nTo switch to a project directory, you don't need to type the full project name.\nFor example, to switch to the `capistrano` project, you could type any of the\nfollowing:\n\n```bash\n$ c capistrano\n$ c cap\n$ c istra\n```\n\nOr if you wanted to go straight to a subdirectory within `capistrano`:\n\n```bash\n$ c cap\u003cTAB\u003e\n$ c capistrano/\u003cTAB\u003e\n# =\u003e bin/   lib/   test/\n$ c capistrano/l\u003cTAB\u003e\n$ c capistrano/lib/\n# =\u003e cd ~/code/gems/capistrano/lib\n```\n\nOr if you want to go to a subdirectory within the `~/code` directory, prefix\nthe first argument with a `/`:\n\n```bash\n~ $ c /gems\n~/code/gems $\n```\n\n### Linking External Project Design Directories\n\nWhen you're creating logos or icons for a project that uses `git`, have you\never wondered where you should store those `.psd` or `.xcf` files? Do you\ncommit all of your raw design files, or does it put you off that any changes to\nthose files will bloat your repository?\n\nHere were my goals when I set out to find a solution:\n\n- I wanted a design directory for each of my projects\n- I didn't want the design directory to be checked in to the git repository\n- The design directory needed to be synchronized across all of my machines\n\nThe simplest way for me to synchronize files was via my Dropbox account.\nHowever, if you work with a larger team, you could set up a shared design\ndirectory on one of your servers and synchronize it with `rsync`.\n\n#### 1) Create and configure a root design directory\n\nI created my root design directory at `~/Dropbox/Design`.\n\nAfter you've created your root design directory, edit `~/.scmbrc` and set\n`root_design_dir` to the directory you just created. You can also configure\nthe design directory that's created in each of your projects (default:\n`design_assets`), as well as the subdirectories you would like to use. The\ndefault base subdirectories are: Images, Backgrounds, Logos, Icons, Mockups,\nand Screenshots.\n\nAfter you have changed these settings, remember to run `source ~/.bashrc` or\n`source \"${ZDOTDIR:-$HOME}/.zshrc\"`.\n\n#### 2) Initialize design directories for your projects\n\nTo set up the design directories and symlinks, go to a project's directory and\nrun:\n\n```bash\ndesign init\n```\n\nIf your root directory is `~/Dropbox/Design`, directories will be created at\n`~/Dropbox/Design/projects/my_project/Backgrounds`,\n`~/Dropbox/Design/projects/my_project/Icons`, etc.\n\nIt will then symlink the project from your root design directory into your\nproject's design directory, so you end up with:\n\n- `my_project/design_assets` -\u003e `~/Dropbox/Design/projects/my_project`\n\nIt also adds this directory to `.git/info/exclude` so that git ignores it.\n\nIf you use the git repository index, you can run the following batch command to\nset up these directories for all of your git repos at once:\n\n```bash\ngit_index --batch-cmd design init\n```\n\nIf you want to remove any empty design directories, run:\n\n```bash\ndesign trim\n```\n\nAnd if you want to remove all of a project's design directories, even if they\ncontain files:\n\n```bash\ndesign rm\n```\n\n#### 3) Link existing design directories into your projects\n\nIf you've set up your design directories on one machine, you'll want them to be\nsynchronized across all of your other development machines.\n\nJust run the following command on your other machines after you've configured\nthe root design directory:\n\n```bash\ndesign link\n```\n\nThis uses your git index to figure out where to create the symlinks. If you\ndon't use the git index, the same outcome could be achieved by running 'design\ninit' for each of the projects.\n\n## Configuration\n\nSCM Breeze is configured via automatically installed `~/.*.scmbrc` files. To\nchange git configuration, edit `~/.git.scmbrc`.\n\nEach feature is modular, so you are free to ignore the parts you don't want to\nuse. Just comment out the relevant line in `~/.scm_breeze/scm_breeze.sh`.\n\n**Note:** After changing any settings, you will need to run `source ~/.bashrc`\n(or `source \"${ZDOTDIR:-$HOME}/.zshrc\"`)\n\nI know we grow attached to the aliases we use every day, so I've made the alias\nsystem completely customizable. You have two options when it comes to aliases:\n\n### 1) Configure and use the provided SCM Breeze aliases\n\nJust tweak the aliases in `~/.git.scmbrc`. You can also change or remove any\nkeyboard shortcuts. These aliases also come with tab completion. For example,\nyou can type `gco \u003ctab\u003e` to tab complete your list of branches.\n\n### 2) Use your own aliases\n\nIn your `git.scmbrc` config file, just set `GIT_SETUP_ALIASES` to `no`.\nYour existing git aliases will then be used, and you will still be able\nto use the numeric shortcuts feature. SCM Breeze creates a function to wrap\nthe 'git' command, which expands numeric arguments, and uses `hub` if\navailable.\n\nA few aliases will still be defined for the central SCM Breeze features, such\nas `gs` for the extended `git status`, and `ga` for the `git add` function.\n\nIf you already have an alias like `alias gco=\"git checkout\"`, you can now type\n`gco 1` to checkout the first file in the output of SCM Breeze's `git status`.\n\n## Custom emojis for username and \"staff\" group\n\nThe `ll` command adds numbered shortcuts to files, but another fun feature is replacing your\nusername and the \"staff\" group with custom emojis. You can set these in `~/.user_sym` and `~/.staff_sym`.\n\n\u003cimg src=\"/docs/images/custom_user_and_staff_symbols.jpg\" width=\"400\" alt=\"Custom user and staff emojis\"\u003e\n\nSet your own emojis by running:\n\n```bash\necho 🍀 \u003e ~/.user_sym\necho 🖥 \u003e ~/.staff_sym\n```\n\nI also like using `~/.user_sym` [in my Bash prompt](https://github.com/ndbroadbent/dotfiles/blob/master/bashrc/prompt.sh#L71).\n\n## Notes about Tab Completion for Aliases\n\n### Bash\n\nIf you use your own aliases, SCM Breeze will **not** set up bash tab completion\nfor your aliases. You will need to set that up yourself.\n\n### Zsh\n\nYou just need to set the option: `setopt no_complete_aliases` (oh-my-zsh sets\nthis by default). Zsh will then expand aliases like `gb` to `git branch`, and\nuse the completion for that.\n\n## Updating\n\nPlease run `update_scm_breeze` to fetch the latest code. This will update SCM\nBreeze from Github, and will create or patch your `~/.*.scmbrc` config files if\nany new settings are added.\n\n## Uninstalling\n\n```bash\n~/.scm_breeze/uninstall.sh\n```\n\nThe uninstall script removes the following line from your `.bashrc` or\n`.zshrc`:\n\n`[ -s \"$HOME/.scm_breeze/scm_breeze.sh\" ] \u0026\u0026 source \"$HOME/.scm_breeze/scm_breeze.sh\"`\n\n## Contributing\n\nSCM Breeze lives on Github at\n[`scmbreeze/scm_breeze`](https://github.com/scmbreeze/scm_breeze)\n\nIf you have any awesome SCM scripts lurking in your `.bashrc` or `.zshrc`,\nplease feel free to send me a pull request. It would be cool to make this\nproject into an [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) for\nSCMs.\n\n**_Enjoy!_**\n\n## Alternative Projects\n\n1. https://github.com/shinriyo/breeze `fish` support\n1. https://github.com/mroth/scmpuff static go binary\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscmbreeze%2Fscm_breeze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscmbreeze%2Fscm_breeze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscmbreeze%2Fscm_breeze/lists"}