Just update |=
the defaultBranchRef
field to the content of its name
subfield:
jq '.[].defaultBranchRef |= .name'
[
{
"defaultBranchRef": "main",
"nameWithOwner": "KyleMit/stack-posts"
},
{
"defaultBranchRef": "master",
"nameWithOwner": "KyleMit/HelloSERN"
}
]
CLICK HERE to find out more related problems solutions.