npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

belly

v1.3.3

Published

> Git shortcuts for common tasks.

Downloads

5

Readme

belly

Git shortcuts for common tasks.

Install

$ npm install --global belly

Why?

There are a few things in Git that I do a lot. Some things I need in regular intervals but I always have to look up the commands. So I created this CLI tool to simplify the Git tasks I need the most.

Why Not Use Git Aliases?

Sure, I could have used Git aliases but I wanted to have something that I can install with npm and I didn't want to be confined to Git aliases. This way I can add some nice visual feedback on the console.

OK, So What Does It Do?

I thought you'd never ask!

belly c [<commit message>]

Stage everything, commit everything and push to origin.

I do this a lot. I commit early and often in my feature branches and always push it to the server. That is what belly c does.

Type belly c and belly will stage everything, commit it with the commit message belly auto-commit and push it to origin.

You can specify a commit message by adding it right after the c.

Sometimes it's fine to just commit with a generic commit message. Especially if it is minor work, you're the only person working on the project or if you'll squash all commits in the end anyway.

belly s [<branch-name>]

Switch to the last branch or to an existing branch or create a new branch.

When we navigate between branches we typically either want to switch to an existing branch or create a new one and switch to that one.

Why do we need multiple commands for that?

belly s does it all. If you don't specify a branch name it just switches to the last branch you were on. If you specify a branch name of an existing branch like: belly s branch-name, it will switch to that. If the branch doesn't exist it will create it and switch to it.

belly t <version.number> [-d]

Tag the current commit with a version number and push tags to the server.

In order to annotated-tag the current commit with a version number and push the tag to the server use belly t <version-number>. You can delete a tag locally and remotely in one go by adding -d at the end.

belly n <new-branch-name>

Rename your local and your remote branch in one go.

belly n <new-branch-name> will rename your local branch with -m <new-branch-name>, then delete your remote branch with push :<current-branch-name> and push the new branch to the server with push -u <new-branch-name>.

belly q <commit-message>

Fetch origin master, rebase the current branch on to origin/master and if it doesn't fail, squash the branch.

If your team wants to keep a clean Git history you will most likely have to rebase your branch on a regular basis and squash your commits into one commit per feature.

belly q is here to help! The command will rebase your current branch on to master just to make sure you rebased (you have to make sure your master is up-to-date). Then it will do a reset --soft back to master and then commit all your changes with the commit message you specified after q.

belly p

If you work with rebasing and squashing in feature branches a lot, you have to force-push a lot. Instead of using push --force it is recommended to use push --force-with-lease. belly p gives you a nice shortcut for doing a --force-with-lease push. Make sure you understand the ways how --force-with-lease can fail you though.

Usage

$ [belly | b] --help

  Usage
    $ belly [c | s | t | n | q]

  Options
    --help       Display this message
    --del or -d  Use this flag in combination with the t command to delete a tag locally and remotely

  Examples
    Commit all staged and unstaged changes with a generic
    commit message and push the commit to origin
    $ belly c

    Commit all staged and unstaged changes with a custom
    commit message and push the commit to origin
    $ belly c Made some awesome changes

    Switch to last branch or switch to/create a branch with a specific name
    $ belly s [some-branch]

    Tag and annotate the current commit with a version number
    and push the tag to origin
    $ belly t 1.4.2

    Delete a tag locally and on the server
    $ belly t 1.4.2 -d

    Rename the current branch locally and on origin
    $ belly n some-branch

    Squash all commits since master
    $ belly q Made some awesome changes

    Force push with `--force-with-lease`
    $ belly p

Why "belly"?

When looking for a name I started with git-shortcuts which was to long so I shortened it to g-cuts. Still too long. guts was cool but a little gross so guts became belly.

License

MIT © Kahlil Lechelt