Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Remote tracking branches not updated
Remote tracking branches not updated [message #789928] Fri, 03 February 2012 15:37 Go to next message
camille chambon is currently offline camille chambonFriend
Messages: 2
Registered: February 2012
Junior Member
Hello,

I have a remote git repository named remote_repository.git. This repository has 2 non-empty branches: origin/master and origin/test.

I clone remote_repository.git 2 times, creating 2 local repositories: developer_1_local_repository.git and developer_2_local_repository.git. For both of them, I import the 2 existing branches: origin/master and origin/test.

In the master branch of developer_1_local_repository.git, I add a file test.txt. I commit the local master branch, and push the commit to origin/master branch of remote_repository.git. The origin/master branch should now contain test.txt.

I refresh all repositories in the "Git Repositories" view.
In the "Git Repositories" view, when I checkout developer_1_local_repository > Branches > Remote tracking > origin/master, I CAN see test.txt in the Working directory.
BUT, when I checkout developer_2_local_repository > Branches > Remote tracking > origin/master, I CAN NOT see test.txt in the Working directory.

Why ???

Thanks in advance.

Camille
Re: Remote tracking branches not updated [message #790008 is a reply to message #789928] Fri, 03 February 2012 17:44 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
You don't see the change in your second local clone because you never fetched it from the origin into that clone.

Also, there's almost never any reason to checkout a remote-reference like origin/master. These are only useful for tracking changes in another repository.

For a good tutorial on Git see ProGit:http://progit.org/book

You can download this for free to iPads and probably other mobile devices.


Re: Remote tracking branches not updated [message #790525 is a reply to message #789928] Sat, 04 February 2012 11:44 Go to previous message
camille chambon is currently offline camille chambonFriend
Messages: 2
Registered: February 2012
Junior Member
Hello, and thanks for your answer.

Quote:
You don't see the change in your second local clone because you never fetched it from the origin into that clone.

So I just have to fetch developer_2_local_repository.git in the "Git Repositories" view, and I will see test.txt? I will try as soon as possible.

Quote:
Also, there's almost never any reason to checkout a remote-reference like origin/master. These are only useful for tracking changes in another repository.

So maybe I'm not using Git in a good way for what I want to do.
In fact, we are several developers: developer_1, developer_2 and developer_3. We decide that each developer has one or several role(s) among: modelisator, scientific_validator or computer_validator.
Let's say that developer_1 is a modelisator, developer_2 is both modelisator and scientific_validator, and developer_3 is computer_validator.
The scientific_validator checks the modelisator work, and the computer_validator checks the scientific_validator work.
Thus I create a remote branch for each developer and a master branch. The remote branches are therefore: origin/developer_1, origin/developer_2, origin/developer_3 and origin/master.
According to developers' roles, we decide the following development cycle:
- developer_1 wants to add modifications to the source code. Thus developer_1 fetches origin/master to his local master branch. Then developer_1 merges his local master branch with his local developer_1 branch. Then developer_1 modifies his local developer_1 branch, commits it, pushes it to origin/developer_1 branch, and notifies developer_2.
- developer_2 wants to check developer_1 work. Thus developer_2 fetches origin/developer_1 branch to his local developer_1 branch. Then developer_2 checks his local developer_1 branch, and corrects it if needed. When the local developer_1 branch seems to be fine, developer_2 merges it to his local developer_2 branch. Finally, developer_2 commits his local developer_2 branch, pushes it to origin/developer_2, and notifies developer_3.
- developer_3 wants to check developer_2 work. Thus developer_3 fetches origin/developer_2 branch to his local developer_2 branch. Then developer_3 checks his local developer_2 branch, and corrects it if needed. When the local developer_2 branch seems to be fine, developer_3 merges it to his local master branch. Finally, developer_3 commits his local master branch, pushes it to origin/master, and notifies all developers.

I agree that could look very complicated, and that there is maybe a smarter and easier way to do the same. But I can't find it.

So...
- is it possible to manage our source code the way I described?
- is there an easier or/and smarter way?

Many thanks in advance.

Camille


Previous Topic:Pulling master back in time
Next Topic:[SOLVED] Git Staging View shows ignored files in EGit 1.2.0+
Goto Forum:
  


Current Time: Thu Apr 25 10:43:02 GMT 2024

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

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

Back to the top