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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:06:46+00:00 2026-05-23T23:06:46+00:00

I am new with both Git and GitHub so please bear with me. I

  • 0

I am new with both Git and GitHub so please bear with me.
I have an empty repository on GitHub with an automatically created branch (gh-pages), which, I understand, is supposed to be used with GitHub’s pages functionality.

Now what I would like to do is to create and eclipse project from which I could commit/push to this repository.

What is confusing me that I can’t see any option to create a remote branch on github. I suppose pushing my source to gh-pages won’t be a good idea. BTW, I also don’t understand why the GitHub pages is feature is implemented as a branch? Aren’t branches supposed to be merged with each other at some point. Clearly it wouldn’t make any sense to merge github pages into my project. Wouldn’t it be better to have a folder within my project for this purpose.

I googled and found this link but being a git noob I am not sure if that’s what I want to do. I would like to use Eclipse as my primary interface to git and github only falling back to command line or other interfaces when there is no other option.


OK I think I have figured it out. Basically, what you need is to define a remote ref that need not exist before hand.

  1. Create a project
  2. Team->Share it to a local repository
  3. In the repository view (Window->Show View-> Git -> Repositories) select the local repository and right click on remotes
  4. Select new remote (configure push). Type origin in the remote name. Press OK
  5. Change URL. Copy/paste the ssh uri from github. Select ssh protocol (make sure you have ssh key defined in eclipse SSH preferences, and uploaded to github)
  6. Now the last part is to add Ref mapping. Click on Add.. in ref mapping section of screen. And enter refs/heads/master in both local and remote branches.

Or may be the refs/heads/master on both side isn’t a good idea 🙂
I see, cloning a github repo that doesn’t have gh-pages branch is simpler as it automatically creates this remote fetch spec

Remote Fetch Specification +refs/heads/*:refs/remotes/origin/*

Maybe this is what I need to enter in the step 6 above


Ok as it turned out the original idea of “refs/heads/master in both local and remote branch” was correct. Pushing with this configuration is showing my changes in git hub correctly. The second option on the other hand is failing silently.

  • 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-23T23:06:47+00:00Added an answer on May 23, 2026 at 11:06 pm

    Branches typically are used in the way you described, but nothing says they must be used that way. This is just the way github chose to let you manage your page content, and it works quite well. It’s kind of similar to hosting multiple repos on one SVN server.

    As for creating new repos, if you create a repo in github and then clone it, you’ll have an empty repo locally that already points to github with a remote named “origin”. This is a convenient way to start out, since you don’t have to mess with adding a remote yourself. At this point, your repo has no commits and no branches in it. When you make the first commit, it will automatically establish a branch named “master”. I don’t know how eclipse is set up by default, but from the command line with default settings, you have to explicitly push new branches to a remote or else they won’t get pushed at all. I.e. making the first commit and doing git push will just fail with a message like “No refs in common and none specified; doing nothing”. Instead, you have to git push origin master to tell it to establish the “master” branch in remote “origin” (aka github). Thereafter, just a git push will work fine.

    Hope that clears up some of your confusion.

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

Sidebar

Related Questions

I'm new to both git and unix so please bear with. I'm trying to
I created a new branch locally called experimental git checkout -b experimental I made
New to both Ruby and Rails but I'm book educated by now (which apparently
I'm new to both Web Services and RMI and I wonder which is the
At a new job I started, we have both a Java application that handles
We have a large enterprise consisting of many apps both old and new backed
I have forked a repository on github some time ago, made a small change
I'm new to both Ruby and to Mac OSX, though I do have a
I am new to both openGL and android development so please forgive me if
I have a project in Codeigniter, managed via Git and Github, that consists of

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.