top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Git, remote bare repositories, Dropbox backed

0 votes
290 views

This may have been asked so many times. But I may not understand the solution.

I'm following: http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server

to create a Git server (remote bare repository). The host containing the Git server has got Dropbox installed. I'd like Dropbox to be my backup of the remote repository.

Here's my problem.

Dropbox files is located /opt/Dropbox. Repos are located /opt/Dropbox/repos. I've created a soft-link from /repos to /opt/Dropbox/repos.

I'd like to set origin to this remote repository.

git remote add origin git@gitserver:/repos/someproj.git
git push origin master

However, it seems the soft link, i.e. /repos, won't allow me to write to the bare repository. The error I receive is:

~/Documents/workspace/test-git:11:35$ git push origin master
fatal: '/repos/someproj.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
~/Documents/workspace/test-git:11:35$

Can anyone help with this scenario?

posted Jul 1, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Supposedly a stupid question, but did you really do

$ cd /repos
$ mkdir someproj.git
$ git init --bare someproj.git

on the server before attempting your push operation?

I mean, Git won't auto-initialize repositories on push; it is only capable of pushing from one existing repository to another existing repository -- the latter might be completely empty but still it must be
a proper Git repository created by git init.

answer Jul 1, 2013 by anonymous
Similar Questions
+1 vote

I just had the bare vs non-bare repo concept smack me in the face. Painful way to learn things, but I won't forget it any time soon. Since my remote repos are no longer work trees, how can I keep two bare repos in sync? This is primarily for DR purposes.

Here's more detail in case it'll help:
I have two rhel6 systems running git 1.7.1 that will be maintaining OS and web configuration files for a variety of teams, once I get the bugs in my understanding ironed out. One git server is in datacenter A (prod) where most of the updates will be occurring. Appropriate people will clone the bare repo, make their updates and push it back. The other git server is at our warm DR site. While rare, updates to this server should be possible.

I need to be able to fetch changes from the production git server and apply them to the DR one. When I tried it straight, I got the expected "fatal: This operation must be run in a work tree"

I suppose I could hack out a script to pull the configs down to a temp repo and push them back up to the DR one (and vice versa), but that seems like a kludge. As flexible and seemingly well thought out as git appears to be, I have to believe there's a better approach.

Could someone clue me in on what I'm missing or how a generic DR process is typically set up?

+1 vote

I want to understand the best practice of organizing the GIT repositories. Let's say:
1. We are a large bank with many line of businesses and tons of application.
2. Each LOB has a large number of applications.

How many repositories shall I use? How do we organize the applications inside one repository? Any reference?

+2 votes

I'm trying to build Git hosting server for a group of people.

  1. I see there are Git hosting that give ability to users to create and manage their repositories. I want to give user ability to create and manage their repository only using http. But in the instruction of http protocol, user with write privileges must login in order to create the repositories.
    Is it can work with http protocol or it must be with ssh?

  2. I would like get recommendation about a software if exist. Is there any software, I can use, that give the ability to see weby and/or visually view status of repositories on the Git server, without cloning or pulling a snapshot from the git server to my local machine and without login to the git server?

+1 vote

I have git version 1.8.4.msysgit.0 installed. If I run this as a daemon, where are the repositories located? (i.e. where do i do a mkdir foo.git; cd foo.git; git init --bare?)

How do I change where the (server) repositories live?

+2 votes

I'm a big Git fan and had the chance to "convert" some colleagues to the benefit of Git over Subversion, leading the conversion process and coaching them for their day-to-day use.
I'm now working in a place where the VCS is Perforce (sigh!). I must admit the cultural gap is non-negligible.
That being said, I did a quick search and found that there is git-p4 to use Git as a "client" to Perforce. Before getting that to work on my workstation, I'd like to know if anybody ever used that tool? If so, what kind of experience have you had with it? Are there any pitfalls, etc...
I'll probably get on setting that toolset in the next few days (next week) and will update this topic with any relevant info.

...