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 8853039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:33:04+00:00 2026-06-14T13:33:04+00:00

I was taught that you could push to and pull from a remote branch

  • 0

I was taught that you could push to and pull from a remote branch matching the name of your current Git branch by doing:

git push origin HEAD

or

git pull origin HEAD

Its always worked for me before, but it strangely doesn’t work sometimes, instead deferring to push/pulling from the master branch instead (which causes a merge on pull… not what I want to do). I know that you can easily push/pull from the branch you’re on by simply using the name of the branch like:

git pull origin name-of-branch-i-want-to-pull-from

Anyway:

  1. Is there some reason that the HEAD is losing track/not pointing to my current branch, like it almost always does?
  2. Is there any way to push/pull to the branch that I’m currently working on (as long as the remote branch’s name matches) without explicitly naming the branch in the command?
  • 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-06-14T13:33:06+00:00Added an answer on June 14, 2026 at 1:33 pm

    Thanks to some serious help by @abackstrom, I was able to fix my issue.
    Essentially, this post was my problem, and solution:

    Git branch named origin/HEAD -> origin/master

    The exact command to “recreate”/track a local HEAD branch/pointer correctly was:

    git remote set-head origin -a
    

    I hope this helps anyone else that runs into this issue.

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

Sidebar

Related Questions

I was taught that in maths we evaluate things, with the acronym BODMAS Brackets,
In Java, it's taught that variables should be kept private to enable better encapsulation,
Inspired by the discussion in this question . We have all been taught that
It is taught in every computer science class and written in many books that
Here's a question that I don't quite understand: The command, system(pause); is taught to
I'm trying to learn this basic thing about processors that should be taught in
My experience and good books had taught me that repeating of the same thing
I was reading an older data-structures book and it said that when you're doing
I'll start by saying I'm self-taught, everything I know I've picked up from programmers
Using php 5.3 and mysqli I return a result set from a query that

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.