Table of Contents
-
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 likegit merge
.
git-try-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
.
Synopsis
# 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:
# Then you will solve all the conflicts of all the commits in one commit,
# no matter how many commits are conflicting.
Installation
git-fork
Create a new branch based on the default branch (usually origin/main
).
Synopsis
# 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:
Implementation notes
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:
# <ensure manually no uncommitted changes are pending>
Installation
git-push2
Push a branch and set the upstream if not already set.
Synopsis
This is the equivalent of:
# if it fails:
Installation
git-delete
Delete a local branch and its upstream branch altogether.
Synopsis
This is the equivalent of:
git branch -d new-branch
git push origin :new-branch
Installation