Skip to main content

git-alias: manage your Git aliases

git-alias is a tool for managing your git aliases.

Install

To install a released version of git-alias:

pip install git-alias

Or to install straight from GitHub:

pip install git+https://github.com/larsks/git-alias

git-alias requires Python 3.7 or later.

Managing aliases

Listing aliases

$ git alias list
conflicts
fix
please
pr
tracking

Installing from a local file

$ git alias -v install examples/pr.alias
INFO:git_alias.main:installing alias pr from examples/pr.alias

Installing from a git repository

$ git alias -v add -R https://github.com/larsks/git-alias examples/pr.alias
INFO:git_alias.main:cloning https://github.com/larsks/git-alias
INFO:git_alias.main:installing alias pr from /tmp/aliasmylwfb93/examples/pr.alias

Show alias expansion

$ git alias show pr
!if [ $# -eq 1 ]; then set -- origin $1; elif [ $# -ne 2 ]; then echo
'Usage: git pr [<remote>] <pr>'; exit 2; fi; git fetch "${1}"
"+pull/${2}/head:pull/${1}/${2}"; git log -1 "pull/${1}/${2}" #

Alias file format

Blank lines and lines beginning with # are discarded. The remaining content will be joined on spaces. For example, this file:

# Create a local branch from a pull request
#
# usage: git pr [<remote>] <pr>
#
# Get a pull request from origin:
#
#   git pr 42
#   git pr origin 42
#
# Either of the above would create local branch pull/origin/42.
#
# Get a pull request from another remote:
#
#   git pr upstream 42

!if [ $# -eq 1 ]; then
  set -- origin $1;
elif [ $# -ne 2 ]; then
  echo 'Usage: git pr [<remote>] <pr>';
  exit 2;
fi;
git fetch "${1}" "+pull/${2}/head:pull/${1}/${2}"; git log -1 "pull/${1}/${2}" #

Results in the following entry in your git configuration file:

	pr = "!if [ $# -eq 1 ]; then set -- origin $1; elif [ $# -ne 2 ]; then echo 'Usage: git pr [<remote>] <pr>'; exit 2; fi; git fetch \"${1}\" \"+pull/${2}/head:pull/${1}/${2}\"; git log -1 \"pull/${1}/${2}\" # "

Metadata

Release files for git-alias 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-alias 0.0.2
File Size Uploaded Provenance
git_alias-0.0.2.tar.gz 3.8 kB Without provenance Details

Release files / git_alias-0.0.2.tar.gz

Download URL git_alias-0.0.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0e7833c35db78bc4e84965e66f76254d19a54301f2b648561c1e472deccb956c
BLAKE2b-256 checksum
How to use checksums
8ad9a3568004e7c5b41c0a134637493a4923d231db953c078a2c78823a3caea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.2 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Security for git-alias 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page