Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Can't add master branch(Please help!!)
Can't add master branch [message #1786741] Thu, 10 May 2018 12:57 Go to next message
Mia Genovese is currently offline Mia GenoveseFriend
Messages: 1
Registered: May 2018
Junior Member
My master branch doesn't exist. I existed in a previous project, but after I deleted that project (so I could switch my master branch to a new project) it can't be found.

When creating a new remote, I use "origin" as my remote name.

Next, I configure the push for the remote 'origin' using the new repository URL I've created in my GitHub account.

Under Ref mappings, it says "No Push Refspec, will push currently checked out branch instead."

I click "Advanced" for the Push Ref Specifications.

The dropdown menu for Source ref only has HEAD, no master.

When I go back to try and add to Ref mappings, I add "refs/heads/master" to the Local branch and Remote branch field.

Then I go back to Advanced, where it says "refs/heads/master is not a valid ref in local repository"

Please help!!
Re: Can't add master branch [message #1786748 is a reply to message #1786741] Thu, 10 May 2018 14:45 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Projects don't have branches but git repositories have them eventually.
From your description I don't know what you did and what your git repository contains.
You can have a completely empty repository without any branches, that's perfectly ok but not really useful.

Open the git repositories view, if you can see your repository there then check which branches it has.
If you miss any local brach you can simply create it ? If you miss any remote tracking branch try to
fetch from your upstream repository, usually you run fetch from upstream for that.

If your repository exists on disk but you don't see it in repositories view you can click the button "Add an existing local git repository to this view" otherwise you can clone it from your git server or start from scratch and create a fresh new repository locally by using the respective buttons in the git repositories view.
Previous Topic:Eclipse Copy/Paste a project under local git control.
Next Topic:Unable to Save Resolved Conflicts in EGIT
Goto Forum:
  


Current Time: Fri Apr 19 14:32:40 GMT 2024

Powered by FUDForum. Page generated in 0.22313 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top