HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git graft — Merge commits from a branch into another branch and delete the source branch. Part of `git-extras`.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandbranchfromclicommitsintomergegit graft

Problem

How to use the git graft command: Merge commits from a branch into another branch and delete the source branch. Part of git-extras. More information: <https://github.com/tj/git-extras/blob/main/Commands.md#git-graft>.

Solution

git graft — Merge commits from a branch into another branch and delete the source branch. Part of git-extras. More information: <https://github.com/tj/git-extras/blob/main/Commands.md#git-graft>.

Merge all commits not present on the target branch from the source branch to target branch, and delete the source branch:
git graft {{source_branch}} {{target_branch}}

Code Snippets

Merge all commits not present on the target branch from the source branch to target branch, and delete the source branch

git graft {{source_branch}} {{target_branch}}

Context

tldr-pages: common/git graft

Revisions (0)

No revisions yet.