8000 GitHub - dominicnunez/shortgit · GitHub
[go: up one dir, main page]

Skip to content
dominicnunezPublic

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

ShortGit

ShortGit provides dg, a small, trust-aware front-end around real Git. It turns repository shorthand into a complete clone command without replacing Git or storing credentials.

dg clone shortgit
    -> git clone -c core.hooksPath=.githooks git@github.com:<default-owner>/shortgit.git

Install

Go 1.26 or newer is required.

go install github.com/dominicnunez/shortgit/cmd/dg@latest

For a local checkout:

go install ./cmd/dg

dg delegates authentication to Git, SSH, Git Credential Manager, or GitHub CLI. It never asks for or stores a GitHub token.

Configure

Set the owner used for unqualified repository names:

dg config set github.default_owner dominicnunez
dg config set github.protocol ssh
dg config show

By default, configuration is stored in the operating system's user config directory under shortgit/config.json. Set DG_CONFIG to use a different file, which is useful for portable installations and tests.

Available settings:

github.host
github.default_owner
github.protocol                       ssh or https
workspace.root
workspace.use_owner_subdirectories    true or false
hooks.path
hooks.enable_for_default_owner         true or false
hooks.trusted_owners                   comma-separated owners
bootstrap.enabled                      true or false

Clone

dg clone shortgit
dg clone shortgit.git
dg clone openai/openai-go
dg clone https://github.com/foo/bar.git

Options can override the configured host, owner, protocol, destination, or hook decision:

dg clone repo --owner another-owner
dg clone repo --https --dir ~/Code/repo
dg clone external/repo --hooks
dg clone repo --no-hooks
dg clone repo --dry-run

Pass native git clone arguments after --. They remain separate process arguments and are never joined into a shell command:

dg clone openai/openai-go -- --depth 1 --branch main

Hook trust

ShortGit can activate a repository's tracked .githooks during clone by passing -c core.hooksPath=.githooks to real Git.

  • Repositories on the configured host under the default owner enable hooks automatically.
  • Owners listed in hooks.trusted_owners enable hooks automatically.
  • Unknown owners and hosts leave hooks disabled.
  • --hooks explicitly trusts hooks for that clone.
  • --no-hooks always disables them.

Repository-local controls:

dg hooks status
dg hooks enable
dg hooks disable

Diagnostics

dg doctor
dg repo status

doctor checks configuration, real Git, the selected authentication transport, and the workspace without printing secrets. repo status reports the current remote, parsed owner/repository, project type, and tracked hook state. It does not replace git status.

Scope

ShortGit intentionally does not implement Git, shadow the git executable, manage credentials, create GitHub repositories, wrap commit/status commands, run arbitrary bootstrap scripts, or provide a plugin system.

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0