List my remote branches (Git)

Command

The following command prints the remote branch names, where you are the author of the last pushed commit.

$ git branch -r | xargs -L1 git show -s --oneline --author="$(git config user.name)" --format="%D"

Explanation

  • git branch -r … Lists all remote branches in the repository
  • xargs -L1 … Forwards output linewise to the next input
  • git show -s … Shows commit details with suppressed diff