I'd like to configure a centralised bare repository in which I can store
a master copy of content. A couple of other systems will clone and
push/pull changes. I don't seem to be able to get things to work as I
would expect, which most likely means that I'm mis-understanding and
doing things incorrectly. Help!

On the server, create the master bare repository:

        server$ cd /one/git
        server$ mkdir m
        server$ cd m
        server$ git init --bare
        Initialized empty Git repository in /one/git/m/
        server$ git annex init origin
        init origin ok

Clone that to the laptop:

        laptop$ cd /other
        laptop$ git clone ssh://server//one/git/m
        Cloning into 'm'...
        Warning: No xauth data; using fake authentication data for X11 
        remote: Counting objects: 5, done.        
        remote: Compressing objects: 100% (3/3), done.        
        remote: Total 5 (delta 0), reused 0 (delta 0)        
        Receiving objects: 100% (5/5), done.
        warning: remote HEAD refers to nonexistent ref, unable to checkout.
        laptop$ cd m
        laptop$ git annex init laptop
        init laptop ok

Set the default upstream:

        laptop$ git branch master --set-upstream origin/master
        fatal: Not a valid object name: 'origin/master'.

This fatal error seems to be the source of the later problems.

Add some content:

        laptop$ git annex addurl 
        addurl kitenet.net_~joey_screencasts_git-annex_coding_in_haskell.ogg 
http://kitenet.net/~joey/screencasts/git-annex_coding_in_haskell.ogg ...) 
--2011-12-15 08:13:10--  
        Resolving kitenet.net (kitenet.net)... 2001:41c8:125:49::10,
        Connecting to kitenet.net (kitenet.net)|2001:41c8:125:49::10|:80... 
        HTTP request sent, awaiting response... 200 OK
        Length: 39362757 (38M) [audio/ogg]
        Saving to: 
        100%[======================================>] 39,362,757  2.31M/s   in 
        2011-12-15 08:13:27 (2.21 MB/s) - 
 saved [39362757/39362757]
        (checksum...) ok
        (Recording state in git...)
        laptop$ git commit -m 'See Joey play.'
        [master (root-commit) 106e923] See Joey play.
         1 files changed, 1 insertions(+), 0 deletions(-)
          create mode 120000 

All fine, now attempt to push it:

        laptop$ git push -v
        Pushing to ssh://server//one/git/m
        Warning: No xauth data; using fake authentication data for X11 
        To ssh://server//one/git/m
         ! [rejected]        git-annex -> git-annex (non-fast-forward)
        error: failed to push some refs to 'ssh://server//one/git/m'
        To prevent you from losing history, non-fast-forward updates were 
        Merge the remote changes (e.g. 'git pull') before pushing again.  See 
        'Note about fast-forwards' section of 'git push --help' for details.

Attachment: pgpGLXZWzuygU.pgp
Description: PGP signature

vcs-home mailing list

Reply via email to