GIt: overwrite one branch with another branch?

如何用一個 git branch 覆蓋另一個 branch

# Make sure your working tree is in a clean state
git status

# Check out the branch you want to change, e.g. some-branch
git checkout some-branch

# Reset that branch to some other branch/commit, e.g. target-branch
git reset --hard target-branch

切換至主要 branch
e.g.
git checkout feat/我的新功能 branch

執行指令進行覆蓋
e.g.
git reset --hard 用來覆蓋別人的 branch

ref.
https://www.reddit.com/r/git/comments/bqx85v/how_do_i_overwrite_one_branch_with_another_branch/

1個讚