Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6177071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:12:33+00:00 2026-05-24T00:12:33+00:00

When you run git branch -r why the blazes does it list origin/HEAD ?

  • 0

When you run git branch -r why the blazes does it list origin/HEAD? For example, there’s a remote repo on GitHub, say, with two branches: master and awesome-feature. If I do git clone to grab it and then go into my new directory and list the branches, I see this:

$ git branch -r
origin/HEAD
origin/master
origin/awesome-feature

Or whatever order it would be in (alpha? I’m faking this example to keep the identity of an innocent repo secret). So what’s the HEAD business? Is it what the last person to push had their HEAD pointed at when they pushed? Won’t that always be whatever it was they pushed? HEADs move around… why do I care what someone’s HEAD pointed at on another machine?

I’m just getting a handle on remote tracking and such, so this is one lingering confusion. Thanks!

EDIT: I was under the impression that dedicated remote repos (like GitHub where no one will ssh in and work on that code, but only pull or push, etc) didn’t and shouldn’t have a HEAD because there was, basically, no working copy. Not so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:12:34+00:00Added an answer on May 24, 2026 at 12:12 am

    @robinst is correct.

    In git, you can select which branch is checked out by default (i.e. when you clone). By default, origin/HEAD will point at that.

    On GitHub, You can change this in the Admin settings for your GitHub repo. You can also do it from the command-line via

    git remote set-head origin trunk
    

    or delete it altogether via

    git remote set-head origin -d
    

    Example. Look at the ‘Switch Branches’ drop-down. trunk is checked, so origin/HEAD follows trunk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run git branch -a, it prints out like this, for ex: branch_a
How do you stop tracking a remote branch in Git ? I am asking
I've done something like following: (1) clone a remote git repository to local host
So I've installed msysgit, and run git successfuly from the bash shell. From within
I'm using git-svn to work with an svn repository. I have my git master
I'm using git-svn to work against my company's central Subversion repository. We've recently created
I'm struggling to understand something about GIT. We've got a repository with a number
Long story short*, I did some things with my git repository that I don't
I have forked an SVN project using Git because I needed to add features
I noticed a moment ago that my .gitconfig -file was public at my repo.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.