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

  • Home
  • SEARCH
  • 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 1066879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:04:43+00:00 2026-05-16T20:04:43+00:00

I’ve been using Git reasonably successfully (perhaps that’s an optimistic evaluation) for going on

  • 0

I’ve been using Git reasonably successfully (perhaps that’s an optimistic evaluation) for going on 2 years now, but have admittedly been doing so somewhat blindly. For whatever reason, I’ve begun to get much more curious about the internals and have been digging into remote tracking branches of late. They make sense on the whole, but I’m left with this question:

When I clone a repository and all of the remote tracking branches are created, what is the “cloned repository’s currently active branch” (quoted from the git-clone documentation)?

If I were cloning from a colleague’s repository, I suppose this would be the tracking branch of whichever local branch has the * in front of it in the git branch results, but what if I were cloning from Github? Is it just the branch that I’ve selected in the interface? Initial tests indicate that this is not the case.

Thanks.

  • 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-16T20:04:44+00:00Added an answer on May 16, 2026 at 8:04 pm

    A Git repository’s currently active branch is the branch to which its HEAD points.

    Internally, HEAD is just a file that lives at the top of the repository’s GIT_DIR (the .git directory of a non-bare repository, or the top of a bare repository). If HEAD looks like ref: refs/some/thing, then it is interpreted as a symref (symbolic reference) to the named ref (usually a branch under refs/heads/). If HEAD contains a 40-byte ASCII hex representation of an object name (SHA-1), then we say it is a “detached HEAD” (since it is not “attached” to a normal branch) and it works like a normal ref (i.e. it works like any other branch).

    As you supposed, git branch will show the currently active branch with an asterisk before it. This works in regular (non-bare) and bare repositories.

    In regular (non-bare) repositories (those with working trees) HEAD is automatically maintained by normal uses of git checkout:

    git checkout other-branch
    # HEAD is now a symref to refs/heads/other-branch
    

    Bare repositories (usually used on servers) have no working tree, so git checkout will not work. To update a bare repository’s HEAD, you have to use git symbolic-ref:

    git symbolic-ref -m 'new default branch' HEAD refs/heads/other-branch
    # HEAD is now a symref to refs/heads/other-branch
    

    In both cases you have to have direct access to the repository to update HEAD to change the currently active branch. Like most hosting providers, GitHub do not provide direct access to repositories. It does, however, provide a web interface that lets users change the HEAD of their repositories (they refer to it as the “default branch”).

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.