git-toggle¶
Toggle Git remotes between https and ssh.
Docs |
|
---|---|
Tests |
|
PyPI |
|
Activity |
|
QA |
|
Other |
Installation¶
python3 -m pip install git-toggle --user
python3 -m pip install git+https://github.com/domdfcoding/git-toggle@master --user
API Reference¶
Toggle Git remotes between https and ssh.
Classes:
|
Represents a remote repository. |
|
Toggle Git remotes between https and ssh. |
-
class
Remote
(style, domain, repo, username)[source]¶ Bases:
object
Represents a remote repository.
- Parameters
Methods:
as_url
()Returns the
apeye.url.URL
representation of the :class;`~.Remote`.from_url
(url)Construct a
Remote
from a url.set_repo
(repo)set_username
(username)Attributes:
The domain of the remote.
The repository the remote points to.
The style of remote.
The account on the remote server which owns the repository.
-
as_url
()[source]¶ Returns the
apeye.url.URL
representation of the :class;`~.Remote`.- Return type
- Returns
-
class
Toggler
(repo, *args, **kwargs)[source]¶ Bases:
Repo
Toggle Git remotes between https and ssh.
Methods:
get_current_remote
([name])Return the current remote.
set_current_remote
(url[, name])Set the current remote.
Overview¶
git-toggle
uses tox to automate testing and packaging,
and pre-commit to maintain code quality.
Install pre-commit
with pip
and install the git hook:
python -m pip install pre-commit
pre-commit install
Coding style¶
formate is used for code formatting.
It can be run manually via pre-commit
:
pre-commit run formate -a
Or, to run the complete autoformatting suite:
pre-commit run -a
Automated tests¶
Tests are run with tox
and pytest
.
To run tests for a specific Python version, such as Python 3.6:
tox -e py36
To run tests for all Python versions, simply run:
tox
Build documentation locally¶
The documentation is powered by Sphinx. A local copy of the documentation can be built with tox
:
tox -e docs
Downloading source code¶
The git-toggle
source code is available on GitHub,
and can be accessed from the following URL: https://github.com/domdfcoding/git-toggle
If you have git
installed, you can clone the repository with the following command:
$ git clone https://github.com/domdfcoding/git-toggle"
> Cloning into 'git-toggle'...
> remote: Enumerating objects: 47, done.
> remote: Counting objects: 100% (47/47), done.
> remote: Compressing objects: 100% (41/41), done.
> remote: Total 173 (delta 16), reused 17 (delta 6), pack-reused 126
> Receiving objects: 100% (173/173), 126.56 KiB | 678.00 KiB/s, done.
> Resolving deltas: 100% (66/66), done.

Downloading a ‘zip’ file of the source code¶
Building from source¶
The recommended way to build git-toggle
is to use tox:
tox -e build
The source and wheel distributions will be in the directory dist
.
If you wish, you may also use pep517.build or another PEP 517-compatible build tool.
View the Function Index or browse the Source Code.