Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Why my remote branches are not checked out locally??
Why my remote branches are not checked out locally?? [message #1150737] Wed, 23 October 2013 00:19 Go to next message
Mohammad Alhobayyeb is currently offline Mohammad AlhobayyebFriend
Messages: 3
Registered: November 2011
Junior Member

I am new to Git and EGit.

I have a new private repository cloned it out and added Eclipse project to it then commit and pushed everything to the master branch.

Now I have deleted the repository from Eclipse. Then added the extra branchs from the website itself as follows:

master [main branch]

I did re-clone my repository by pasting the repository link then I selected all branches then I selected master as my initial branch and configured remote name to be origin (the default options) I also checked import all existing project because I have added a project in previous steps. Then I clicked finish.

Now my repository look like this:
In the [Branches] tree there are two subtrees:
----Remote Tracking

Why I am not having my branches in my local repository?
How can I bring them to the local repository?

I noticed that I can checkout and work with master from Local and master from Remote Tracking, what are the differences?

I also noticed that I can checkout branches from Remote Tracking. Is it OK to work with checking these branches from Remote Tracking tree?

Thank you,

[Updated on: Wed, 23 October 2013 00:21]

Report message to a moderator

Re: Why my remote branches are not checked out locally?? [message #1152111 is a reply to message #1150737] Wed, 23 October 2013 20:36 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1105
Registered: July 2009
Senior Member
git has 2 types of branches:

local branch:
- used to create new commits in the local repository
- the currently checked out local branch will move when you create a new commit

remote tracking branch:
- proxy for the respective branch of the corresponding remote,
e.g. remotes/origin/master proxies the master branch in remote origin
- remote tracking branch is moving when you fetch new commits from the remote,
when the branch in the remote moved since new commits arrived in that branch
fetch will bring them to your local repository and move the corresponding remote
tracking branch so that it reflects the state of the branch in the remote

This means if you want to create new commits in your local repository you need to
create and checkout a local branch based on the remote tracking branch you want
to push the new commit to.

You can also checkout a remote tracking branch e.g. to test that version, but it
will not move when you create a new commit since remote tracking branches
only move when fetch brings new commits from the remote repository.
Previous Topic:JGit on DFS?
Next Topic:Installing EGit from Eclipse Marketplace
Goto Forum:

Current Time: Fri Dec 06 15:28:38 GMT 2019

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

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

Back to the top