Git

Git #

Copy content of a branch #

git checkout old_branch
git branch new_branch

or shorter, when you are already on old_branch:

git checkout -b new_branch

or

git switch -c new_branch old_branch

where -c stands for --copy.

Delete local branch #

git branch --delete branch_name

What changed between two commits #

git diff ID1..ID2
git diff abc123..def456
git diff HEAD~1..HEAD~3

src