Skip to content

Instantly share code, notes, and snippets.

@ummahusla
ummahusla / git-overwrite-branch.sh
Last active October 31, 2025 17:15 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name