Scroll to navigation

SJ(1) User Commands SJ(1)

NAME

sj - SugarJar, a Git/GitHub helper

SYNOPSIS

sj <command> [<args>] [<options>]

DESCRIPTION

Command, args, and options, can appear in any order.

OPTIONS:

--[no-]fallthru
Fall-thru to git
Github CLI to use ("gh" or "hub"). Note that support for "gh" is currently experimental. default: "hub"
The host for "hub". Note that we will set this in the local repo config so there is no need to have multiple config files for multiple github servers. Put your default one in your config file, and simply specify this option the first time you clone or touch a repo and it will be part of that repo until changed.
Github username
Print this help message
Tell command that check for a dirty repo to carry on anyway.
Ignore preprun failure on *push commands.
Set logging level (fatal, error, warning, info, debug, trace). Default: info
--[no-]use-color
Enable color. [default: true]

--version

COMMANDS:

amend
Amend the current commit. Alias for "git commit --amend". Accepts other arguments such as "-a" or files.
amendq, qamend
Same as "amend" but without changing the message. Alias for "git commit --amend --no-edit".
bclean
If safe, delete the current branch. Unlike "git branch -d", bclean can handle squash-merged branches. Think of it as a smarter "git branch -d".
bcleanall
Walk all branches, and try to delete them if it's safe. See "bclean" for details.
binfo
Verbose information about the current branch.
br
Verbose branch list. An alias for "git branch -v".
feature
Create a "feature" branch. It's morally equivalent to "git checkout -b" except it defaults to creating it based on some form of 'master' instead of your current branch. In order of preference it will be upstream/master, origin/master, master, depending upon what remotes are available.
forcepush, fpush
The same as "smartpush", but uses "--force-with-lease". This is a "safer" way of doing force-pushes and is the recommended way to push after rebasing or amending. Never do this to shared branches. Very convenient for keeping the branch behind a pullrequest clean.
lint
Run any linters configured in .sugarjar.yaml.
pullsuggestions, ps
Pull any suggestions *that have been committed* in the GitHub UI. This will show the diff and prompt for confirmation before merging. Note that a fast-forward merge will be used.
smartclone, sclone
A smart wrapper to "git clone" that handles forking and managing remotes for you. It will clone a git repository using hub-style short name ("$org/$repo"). If the org of the repository is not the same as your github-user then it will fork the repo for you to your account (if not already done) and then setup your remotes so that "origin" is your fork and "upstream" is the upstream.
smartlog, sl
Inspired by Facebook's "sl" extension to Mercurial, this command will show you a tree of all your local branches relative to your upstream.
smartpullrequest, smartpr, spr
A smart wrapper to "hub pull-request" that checks if your repo is dirty before creating the pull request.
smartpush, spush
A smart wrapper to "git push" that runs whatever is defined in "on_push" in .sugarjar.yml, and only pushes if they succeed.
unit
Run any unitests configured in .sugarjar.yaml.
up
Rebase the current branch on upstream/master or origin/master.
upall
Same as "up", but for all branches.
version
Print the version of sugarjar, and then run 'hub version' to show the hub and git versions.

git version 2.35.1 hub version 2.14.2

October 2022 sugarjar version 0.0.11