The git_well Module
===================
|Pypi| |PypiDownloads| |GithubActions| |Codecov| |ReadTheDocs|
+------------------+----------------------------------------------+
| Read the docs | https://python-git-well.readthedocs.io |
+------------------+----------------------------------------------+
| Github | https://github.com/Erotemic/git_well |
+------------------+----------------------------------------------+
| Pypi | https://pypi.org/project/git_well |
+------------------+----------------------------------------------+
Git Well is a collection of git command line tools and is also a Python
module.
Installing this module installs the ``git-well`` command, which is a modal CLI
into several new git commands. These git commands are also exposed as
standalone "git" executables.
In other words after you:
.. code:: bash
pip install git-well
To get CLI argument completion install `autocomplete
<https://pypi.org/project/argcomplete/>`_, and you can enable global
auto-completion
.. code:: bash
pip install argcomplete
mkdir -p ~/.bash_completion.d
activate-global-python-argcomplete --dest ~/.bash_completion.d
source ~/.bash_completion.d/python-argcomplete
And add this to your .bashrc
.. code:: bash
if [ -f "$HOME/.bash_completion.d/python-argcomplete" ]; then
# shellcheck disable=SC1091
source "$HOME"/.bash_completion.d/python-argcomplete
fi
NOTE: if you know of a way to make this easier please let me know!
Then you can run
.. code:: bash
# Show all the commands exposed by this repo.
git well --help
git well sync --help
# OR
git sync
Top Level CLI:
.. code::
usage: git-well [-h] {squash_streaks,branch_upgrade,sync,branch_cleanup,track_upstream,rebase_add_continue,remote_protocol,discover_remote} ...
options:
-h, --help show this help message and exit
commands:
{squash_streaks,branch_upgrade,sync,branch_cleanup,track_upstream,rebase_add_continue,remote_protocol,discover_remote}
specify a command to run
squash_streaks Squashes consecutive commits that meet a specified criteiron.
branch_upgrade Upgrade to the latest "dev" branch. I.e. search for the branch
sync Sync a git repo with a remote server via ssh
branch_cleanup Cleanup branches that have been merged into main.
track_upstream Set the branch upstream with sensible defaults if possible.
rebase_add_continue
A single step to make rebasing easier.
remote_protocol Helper to change a remote from https to ssh / git for a specific user /
discover_remote Attempt to discover a ssh remote based on an ssh host.
The tools in this module are derived from:
* https://github.com/Erotemic/git-sync
* https://github.com/Erotemic/local/tree/main/git_tools
Use Cases
---------
Have you ever run into this error when you run ``git pull``?
.. code::
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> the_current_branch
I find this a huge pain because it can't even be bothered to fill in `<branch>` so you have to munge the command to type:
.. code::
git branch --set-upstream-to=origin/the_current_branch the_current_branch
I get why they did this, the branch on the remote might have a different name.
But... it usually doesn't. That's why I implemented ``git-well track-upstream``.
Running this instead will detect if you are in the simple case and just do it
for you. Otherwise it will enumerate your options and ask you to pick one.
I've found this command to prevent so much disruption that instaling git-well
install ``git track-upstream`` as its own command.
.. |Pypi| image:: https://img.shields.io/pypi/v/git_well.svg
:target: https://pypi.python.org/pypi/git_well
.. |PypiDownloads| image:: https://img.shields.io/pypi/dm/git_well.svg
:target: https://pypistats.org/packages/git_well
.. |GithubActions| image:: https://github.com/Erotemic/git_well/actions/workflows/tests.yml/badge.svg?branch=main
:target: https://github.com/Erotemic/git_well/actions?query=branch%3Amain
.. |Codecov| image:: https://codecov.io/github/Erotemic/git_well/badge.svg?branch=main&service=github
:target: https://codecov.io/github/Erotemic/git_well?branch=main
.. |ReadTheDocs| image:: https://readthedocs.org/projects/python-git_well/badge/?version=latest
:target: http://python-git-well.readthedocs.io/en/latest/
Raw data
{
"_id": null,
"home_page": "https://github.com/Erotemic/git_well",
"name": "git-well",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Jon Crall",
"author_email": "erotemic@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b3/a0/36f8cafa7fed086ca9fdfd327f54bc94e222b8632216b96584a7f924b8f4/git_well-0.2.3.tar.gz",
"platform": null,
"description": "The git_well Module\n===================\n\n\n|Pypi| |PypiDownloads| |GithubActions| |Codecov| |ReadTheDocs|\n\n+------------------+----------------------------------------------+\n| Read the docs | https://python-git-well.readthedocs.io |\n+------------------+----------------------------------------------+\n| Github | https://github.com/Erotemic/git_well |\n+------------------+----------------------------------------------+\n| Pypi | https://pypi.org/project/git_well |\n+------------------+----------------------------------------------+\n\nGit Well is a collection of git command line tools and is also a Python\nmodule.\n\nInstalling this module installs the ``git-well`` command, which is a modal CLI\ninto several new git commands. These git commands are also exposed as\nstandalone \"git\" executables.\n\nIn other words after you:\n\n.. code:: bash\n\n pip install git-well\n\nTo get CLI argument completion install `autocomplete\n<https://pypi.org/project/argcomplete/>`_, and you can enable global\nauto-completion\n\n.. code:: bash\n\n pip install argcomplete\n mkdir -p ~/.bash_completion.d\n activate-global-python-argcomplete --dest ~/.bash_completion.d\n source ~/.bash_completion.d/python-argcomplete\n\nAnd add this to your .bashrc\n\n.. code:: bash\n\n if [ -f \"$HOME/.bash_completion.d/python-argcomplete\" ]; then\n # shellcheck disable=SC1091\n source \"$HOME\"/.bash_completion.d/python-argcomplete\n fi\n\n\nNOTE: if you know of a way to make this easier please let me know!\n\n\nThen you can run\n\n.. code:: bash\n\n # Show all the commands exposed by this repo.\n git well --help\n\n git well sync --help\n\n # OR\n\n git sync\n\n\nTop Level CLI:\n\n.. code::\n\n usage: git-well [-h] {squash_streaks,branch_upgrade,sync,branch_cleanup,track_upstream,rebase_add_continue,remote_protocol,discover_remote} ...\n\n options:\n -h, --help show this help message and exit\n\n commands:\n {squash_streaks,branch_upgrade,sync,branch_cleanup,track_upstream,rebase_add_continue,remote_protocol,discover_remote}\n specify a command to run\n squash_streaks Squashes consecutive commits that meet a specified criteiron.\n branch_upgrade Upgrade to the latest \"dev\" branch. I.e. search for the branch\n sync Sync a git repo with a remote server via ssh\n branch_cleanup Cleanup branches that have been merged into main.\n track_upstream Set the branch upstream with sensible defaults if possible.\n rebase_add_continue\n A single step to make rebasing easier.\n remote_protocol Helper to change a remote from https to ssh / git for a specific user /\n discover_remote Attempt to discover a ssh remote based on an ssh host.\n\n\n\n\nThe tools in this module are derived from:\n\n* https://github.com/Erotemic/git-sync\n* https://github.com/Erotemic/local/tree/main/git_tools\n\n\n\nUse Cases\n---------\n\nHave you ever run into this error when you run ``git pull``?\n\n.. code::\n\n There is no tracking information for the current branch.\n Please specify which branch you want to merge with.\n See git-pull(1) for details.\n\n git pull <remote> <branch>\n\n If you wish to set tracking information for this branch you can do so with:\n\n git branch --set-upstream-to=origin/<branch> the_current_branch\n\nI find this a huge pain because it can't even be bothered to fill in `<branch>` so you have to munge the command to type:\n\n.. code::\n\n git branch --set-upstream-to=origin/the_current_branch the_current_branch\n\n\nI get why they did this, the branch on the remote might have a different name.\nBut... it usually doesn't. That's why I implemented ``git-well track-upstream``.\n\n\nRunning this instead will detect if you are in the simple case and just do it\nfor you. Otherwise it will enumerate your options and ask you to pick one.\n\nI've found this command to prevent so much disruption that instaling git-well\ninstall ``git track-upstream`` as its own command.\n\n\n\n\n.. |Pypi| image:: https://img.shields.io/pypi/v/git_well.svg\n :target: https://pypi.python.org/pypi/git_well\n\n.. |PypiDownloads| image:: https://img.shields.io/pypi/dm/git_well.svg\n :target: https://pypistats.org/packages/git_well\n\n.. |GithubActions| image:: https://github.com/Erotemic/git_well/actions/workflows/tests.yml/badge.svg?branch=main\n :target: https://github.com/Erotemic/git_well/actions?query=branch%3Amain\n\n.. |Codecov| image:: https://codecov.io/github/Erotemic/git_well/badge.svg?branch=main&service=github\n :target: https://codecov.io/github/Erotemic/git_well?branch=main\n\n.. |ReadTheDocs| image:: https://readthedocs.org/projects/python-git_well/badge/?version=latest\n :target: http://python-git-well.readthedocs.io/en/latest/\n",
"bugtrack_url": null,
"license": "Apache 2",
"summary": "The git_well module",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://github.com/Erotemic/git_well"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "946abc2c1a76dd0149f9be8677f585e0035da9713129869b1aae9862d50d04a0",
"md5": "8f2fda52c44be84a93af1ae6e6ec6a32",
"sha256": "57c1870355e77664b88ab491f824765b2934bdd43ab922c0030140c996c550d5"
},
"downloads": -1,
"filename": "git_well-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8f2fda52c44be84a93af1ae6e6ec6a32",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 46206,
"upload_time": "2024-05-31T00:47:08",
"upload_time_iso_8601": "2024-05-31T00:47:08.286203Z",
"url": "https://files.pythonhosted.org/packages/94/6a/bc2c1a76dd0149f9be8677f585e0035da9713129869b1aae9862d50d04a0/git_well-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b3a036f8cafa7fed086ca9fdfd327f54bc94e222b8632216b96584a7f924b8f4",
"md5": "01bd64a403cb71f0366c3387b2f361a8",
"sha256": "f60987a4db481f3eb37fd0d2d62e242cfb582221dae6c88e2ceb501d67346104"
},
"downloads": -1,
"filename": "git_well-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "01bd64a403cb71f0366c3387b2f361a8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 42667,
"upload_time": "2024-05-31T00:47:11",
"upload_time_iso_8601": "2024-05-31T00:47:11.559178Z",
"url": "https://files.pythonhosted.org/packages/b3/a0/36f8cafa7fed086ca9fdfd327f54bc94e222b8632216b96584a7f924b8f4/git_well-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-31 00:47:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Erotemic",
"github_project": "git_well",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "git-well"
}