Archive Git Branch
If you want to archive a branch in Git follow below steps:
Check out the branch you want to archive:
git checkout <branch-to-archive>Create a new branch from the branch you want to archive:
git checkout -b archive/<branch-to-archive>Push the new branch to the remote:
git push origin archive/<branch-to-archive>Delete the branch you want to archive:
git branch -d <branch-to-archive>Push the deletion to the remote:
git push origin :<branch-to-archive>Delete the branch on the remote:
git push origin --delete <branch-to-archive>Verify that the branch is deleted:
git branch -a