How to work with a local hosted rhodecode mercurial git repository

381 Views Asked by At

I have worked with CVS, SVN, Mercurial... but everytime I try do something with GIT I seem not to understand its philosophy.

I have a private Rhodecode server, where I wanted to have a copy of a public git repository.

Performed the following steps:

  • I cloned the public repository
  • Copied it to my rhodecode server into an empty git repository
  • Did a git clone on another machine
  • Created a branch and did some modification
  • Commit
  • Push: "Refusing to update branch in a non bare repository"

If I clone as a bare repository I do not have a working copy, so this seems no solution either.

Why am I not able to push my changes to the server ? Is there another working flow for getting a public repo into Rhodecode ?

There are some git options you can change to ignore this error, but I have a feeling this is not a proper solution.

In something like Mercurial this is not problem, but GIT is rather cryptic.

2

There are 2 best solutions below

0
Waldorf On

The question from Igal S shined me a light.

There is a lot of confusing information on the internet related to bare and non-bare git repositories. Actually it seems the concept is simple: A bare repository does not have a working copy and is the type that should be on a remote server where you want to push changes.
The soludion was simple:

  • Clone the public repository as bare
  • Copy that into the rhodecode store.

    After this it worked as expected.
0
marcinkuzminski On

In order to safely exchange information server side, RhodeCode needs to operate on GIT Bare repositories. Server side this is the only way to allow exchange. Client side you simply grab the repositories in non-bare format.

Is there anywhere we as RhodeCode team could put more information so it's more clear to people using this for the first time ?