| Crates.io | git-tools |
| lib.rs | git-tools |
| version | 0.1.4 |
| created_at | 2020-10-17 11:51:04.629761+00 |
| updated_at | 2025-06-24 11:55:53.114233+00 |
| description | Git subcommands to help with your workflow. |
| homepage | https://github.com/cecton/git-tools |
| repository | https://github.com/cecton/git-tools |
| max_upload_size | |
| id | 301317 |
| size | 60,911 |
Delete a local branch and its upstream branch altogether.
Create a new branch based on the default branch (usually origin/main).
Push a branch and set the upstream if not already set.
Does like a git merge origin/main but helps you resolve the conflicting
commits one by one instead than having to solve them altogether like
git merge.
Does like a git merge origin/main but helps you resolve the conflicting
commits one by one instead than having to solve them altogether like
git merge.
git try-merge
# 1. Merge as many non-conflicting commits as possible under one merge commit
# (if any)
# 2. Merge the first conflicting commit alone
# (if any)
#
# Then you need to repeat the command `git try-merge` until your branch is
# fully updated.
#
# The point: all the conflicting commits will be merged one-by-one which will
# allow you to fully understand the reason of the conflict and solve them
# separately. (A bit like `git rebase` would do.)
There is no real equivalent purely with Git's CLI. This is the closest:
git fetch
git merge origin/main
# Then you will solve all the conflicts of all the commits in one commit,
# no matter how many commits are conflicting.
cargo install git-tools --bin git-try-merge
Create a new branch based on the default branch (usually origin/main).
git fork new-branch
# This command will:
# - make sure there is no uncommitted changes (clean state)
# - fetch (update) origin/main (or your default branch)
# - create a new branch "new-branch" that will be based on origin/main
# - checkout on this new branch
More or less equivalent to:
git checkout main
git pull --ff-only
git checkout -b new-branch
The local branch main will not be updated. In fact, you don't even need a local branch main. The exact equivalent with Git would be more something like this:
git fetch origin main
# <ensure manually no uncommitted changes are pending>
git branch -f new-branch origin/main
git checkout new-branch
cargo install git-tools --bin git-fork
Push a branch and set the upstream if not already set.
git push2
This is the equivalent of:
git push
# if it fails:
git push --set-upstream origin new-branch
cargo install git-tools --bin git-push2
Delete a local branch and its upstream branch altogether.
git delete new-branch
This is the equivalent of:
git branch -d new-branch
git push origin :new-branch
cargo install git-tools --bin git-delete