79278387

Date: 2024-12-13 12:57:01
Score: 1.5
Natty:
Report link
  1. git branch --sort=refname: sort Branches Alphabetically.
  2. grep -E "^*|^": Filters the list, ensuring the current branch (marked with *) is shown first 3.sort -k1,1r: Sorts branches, ensuring the current branch is displayed at the top.

You can run directly the below command to sort current branch in first git branch --sort=refname | grep -E "^*|^" | sort -k1,1r

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Abinash Mohanty