Useful GIT command I sometimes need

Some git command I need the most

Sep 15, 2024 · 48 words

Instead of just searching the doc, here is what I need to remember :

Rename a branch (and apply the new name remotely)

git branch -m OLD-BRANCH-NAME NEW-BRANCH-NAME
git fetch origin
git branch -u origin/NEW-BRANCH-NAME NEW-BRANCH-NAME
git remote set-head origin -a
git remote prune origin

Docs on github