Merge, Rebase, Reset, Clean

merge vs rebase

https://www.atlassian.com/git/tutorials/merging-vs-rebasing

Make the current Git branch a master branch

git checkout better_branch
git merge --strategy=ours master    # keep the content of this branch, but record a merge
git checkout master
git merge better_branch             # fast-forward master up to the merge

rename branch (local and remote)

reset last commit(s)

merge (force remote)

git fetch --all
git reset --hard origin/master

mergetool

[diff]
    tool = meld
[difftool]
    prompt = false
[difftool "meld"]
    cmd = meld "$LOCAL" "$REMOTE"
    
[merge]
    tool = meld
[mergetool "meld"]
    # Choose one of these 2 lines (not both!) explained below.
    cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
 #   cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"

clean up

git clean -d -x ( -n | -i | -f )

will remove untracked files


Created 2022-10-27 16:42:33 UTC by Daniel Raab
Updated 2025-04-24 14:51:31 UTC by Daniel Raab