Some Git Branching Commands
Fetch that includes the removal of remote branches
$ git fetch -p
Delete a Remote Branch in Git
$ git push --delete <remote_name> <branch_name>
To delete the local branch use one of the following:
$ git branch -d branch_name $ git branch -D branch_name
-d option is an alias for
--delete, which only deletes the branch if it has already been fully merged in its upstream branch.
You could also use
-D, which is an alias for
--delete --force, which deletes the branch irrespective of its merged status.
Delete a List of Branches
$ git for-each-ref --format="%(refname:short)" refs/heads/PATTERN-\* | xargs git branch -D
Rename a Branch
$ git branch -m <oldname> <newname>
Or if you want to rename the current branch
$ git branch -m <newname>
Rebase and Keep the Original Commit Dates
$ git rebase --committer-date-is-author-date remote/branch
Is not possible with interactive rebase.