I have tried using git branch -r --no-merged but may have branches which were never merged. So, need to list only active remote branches and not all remote branches. Please share command for the same.
Asked
Active
Viewed 310 times
0
-
Note that Git itself has no notion of "active" or "inactive" branches. GitHub and Bitbucket have both made up their own (probably slightly different) definitions for these. – torek Feb 04 '21 at 10:19
1 Answers
0
Considering even the BitBucket API listing branches does not mention any "active" attributes, that particular feature (list of active branches) is likely to not be readily available.
You would need to fetch and display each branch last commit date, to determine which one were "recently" updated:
git fetch && \
git branch -av --format='\''%(authordate)%09%(authordate:relative)%09%(refname)'\'

VonC
- 1,262,500
- 529
- 4,410
- 5,250