Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Fetching on a bare repo
Fetching on a bare repo [message #1622929] Wed, 18 February 2015 20:57 Go to next message
Giovanni J is currently offline Giovanni JFriend
Messages: 15
Registered: November 2014
Junior Member
Hello I have a bare repository which acts as broker between a locally shared repository (filesharing between two workstations) and a remote one (bitbucket).

It works quite good, I'm able to push changes without problems. Every change is automatically deployed first on the local repo then on the bare one which in turn handles the Upstream push towards bitbucket.

The bare repo contains 2 branches: A remote and a local one. In the "Configure Branch" tab, the local branch is linked to the remote.

The only problem occurs if I commit a change on the bitbucket directly (e.g using the web interface), since while fetching, the change is not deployed to the local branch, it remains stuck on the remote branch of the bare repo.

Indeed, when I click on "Fetch from Upstream" the remote branch gets updated but the local one doesn't.

It's like they're not bound altogether for fetching.
Checking the references i just have FETCH_HEAD instance.

Any help?

Let's try to figure out... is merge not occurring in a bidirectional way? I mean it works while pushing but it doesn't while fetching.

[Updated on: Wed, 18 February 2015 21:02]

Report message to a moderator

Re: Fetching on a bare repo [message #1622967 is a reply to message #1622929] Wed, 18 February 2015 21:33 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Fetch only updates remote tracking branches, this is by design.

If you also want to merge the change into a local branch in the non-bare repository
you can use pull and this local branch needs to be configured to track the corresponding
remote tracking branch.

I don't yet understand what's the purpose of this additional indirection.
Re: Fetching on a bare repo [message #1622996 is a reply to message #1622967] Wed, 18 February 2015 21:57 Go to previous messageGo to next message
Giovanni J is currently offline Giovanni JFriend
Messages: 15
Registered: November 2014
Junior Member
Well I'll try to explain why I want to implement such concept.

I have 2 workstation: MASTER and SLAVE and i'd like to share a git repo between them. In order to do that I set up a shared folder and created a branch.

Now the situation is getting tangled, since I also have a remote repo on bitbucket and I only want to authorize MASTER to push to that online repository.

Then I created a bare repo to link both: the shared branch with the remote one.

This's the pushing data-flow:
SLAVE:shared-->MASTER:shared->MASTER:bare-->REMOTE:BITBUCKET

Pushing operations work, instead, feching ops don't.
In particular, the problem is tied with MASTER:bare.

MASTER:bare is made out of 2 branches: REMOTE and LOCAL, when i try to fetch the REMOTE, it gets updated while changes are not reflected on LOCAL, it remains stale.

[Updated on: Wed, 18 February 2015 21:59]

Report message to a moderator

Re: Fetching on a bare repo [message #1623020 is a reply to message #1622996] Wed, 18 February 2015 22:17 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Giovanni J wrote on Wed, 18 February 2015 16:57

This's the pushing data-flow:
SLAVE:shared-->MASTER:shared->MASTER:bare-->REMOTE:BITBUCKET


I don't understand what you mean with

SLAVE:shared-->MASTER:shared->MASTER:bare-->REMOTE:BITBUCKET

which of these is a machine, repository or branch ?
Do you modify the same repository through file share, nfs mount from 2 different machines or are you using git transport over file protocol and have 2 different repositories on MASTER and SLAVE ?
Re: Fetching on a bare repo [message #1623683 is a reply to message #1623020] Thu, 19 February 2015 08:51 Go to previous message
Giovanni J is currently offline Giovanni JFriend
Messages: 15
Registered: November 2014
Junior Member
MASTER is a Workstation
SLAVE is a Workstation

Each workstation has a local git repository - with its own Working dir.
MASTER --> master-local.git = Branch: project, Remote:BARE
SLAVE --> slave-local.git = Branch: project, Remote:BARE

Both repo's have a unique local branch called: project

Now, the two local repo's point to another git repo that's BARE, basically the BARE one is defined as remote for both master-local.git and slave-local.git.

The BARE repo is stored in a shared folder (under Windows) thus both MASTER and SLAVE have access to it as Remote entity. Moreover I can control the BARE repo only from the MASTER workstation which it's linked to.

SHARED FOLDER--> bare-repo.git -> Branch: project, REMOTE:bitbucket

The Bare repo has a branch called project like the other two and its Remote instance points to a bitbucket repository.

So far, you have got a backdrop of my architecture and what's the problem you could wonder.

Well, when I push a change from SLAVE in smoothly lands on MASTER, then just in case, i can push it further towards bitbucket (push to Upstream on the Bare repo) with no problems at all.

But if I change something remotely, let's say on bitbucket directly... the change is not reflected back to the project branch of the Bare repository then the chain is interrupted.

I should merge the remote branch of the BARE to the local branch of the BARE as well.

I know it's quite complicated... i hope it helps.

[Updated on: Thu, 19 February 2015 10:30]

Report message to a moderator

Previous Topic:Git Pull introduces unstaged changes
Next Topic:jgit: glog how to keep branches in the same lane
Goto Forum:
  


Current Time: Fri Apr 26 20:53:16 GMT 2024

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

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

Back to the top