|Why my remote branches are not checked out locally?? [message #1150737]
||Tue, 22 October 2013 20:19
| Mohammad Alhobayyeb
Registered: November 2011
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:
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?
[Updated on: Tue, 22 October 2013 20: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 16:36
| Matthias Sohn
Registered: July 2009
git has 2 types of branches:|
- 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.
Powered by FUDForum
. Page generated in 0.01608 seconds