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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:28:13+00:00 2026-05-28T03:28:13+00:00

Sometimes I want to be able to pull from a repo (via clone). But

  • 0

Sometimes I want to be able to pull from a repo (via clone). But when I do that and then change to a local branch to pull-in a remote branch, git assumes I want to take the main branch and integrate it. How do I avoid this? I’m sure I can achieve what I want by a different series of actions/commands.

I’d say I normally run into this when I want to work on a specific branch on a secondary machine.

update:
I run the following commands on a secondary machine where I only want to work on the experiment branch

git clone http://somewhere.com/something.git    
git branch experiment    
git checkout experiment   
git pull origin experiement    
  • 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-28T03:28:13+00:00Added an answer on May 28, 2026 at 3:28 am

    Each branch needs to point at some commit. If you don’t specify anything, git branch points the new branch at at the same commit as HEAD.

    You want the branch to point at origin/experiment instead:

    git clone http://somewhere.com/something.git
    cd something
    git branch experiment origin/experiment
    git checkout experiment
    

    or…

    git clone http://somewhere.com/something.git
    cd something
    git checkout -b experiment origin/experiment
    

    or, since git is smart enough to know what you’re trying to do in this case…

    git clone http://somewhere.com/something.git
    cd something
    git checkout experiment
    

    All of these will do the same thing (create the new branch pointing at origin/experiment). They’ll also set the branch up to track origin/experiment, so push and pull will be to and from that remote branch.

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

Sidebar

Related Questions

Sometimes I want to build Python or GCC from scratch just for fun, but
I know that Java have its own garbage collection, but sometimes I want to
Sometimes I want to return the value that is a property of an object
I have 2 classes both inherit from the same interface. i want sometimes to
Windows's Snipping tool can capture the screen, but sometimes I want to capture the
I am using SqlDataReader to read data from SQL Server. However sometimes I want
I want to be able to return all of the parameters that are being
When i launch the scrollMyScreen function, i want to be able to SOMETIMES call
Say I have an array of objects that I want to be able to
If I'm not online, I sometimes want to package some changes to a commit,

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.