Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Justintime50
Last active January 4, 2023 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Justintime50/26c1b2dc8c1f97348de2c376804941e5 to your computer and use it in GitHub Desktop.
Save Justintime50/26c1b2dc8c1f97348de2c376804941e5 to your computer and use it in GitHub Desktop.
Grab the remote repo's default branch name

Grab a Remote Repo's Default Branch Name

git remote show REMOTE_REPO_URL | grep 'HEAD branch' | cut -d' ' -f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment