git-annex: Puzzling over bare repositories

David Edmondson dme at
Thu Dec 15 09:25:53 CET 2011

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 forwarding.
	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 (downloading ...) --2011-12-15 08:13:10--
	Resolving ( 2001:41c8:125:49::10,
	Connecting to (|2001:41c8:125:49::10|:80... connected.
	HTTP request sent, awaiting response... 200 OK
	Length: 39362757 (38M) [audio/ogg]
	Saving to: `/other/m/.git/annex/tmp/URL--http&'
	100%[======================================>] 39,362,757  2.31M/s   in 17s     
	2011-12-15 08:13:27 (2.21 MB/s) - `/other/m/.git/annex/tmp/URL--http&' 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 kitenet.net_~joey_screencasts_git-annex_coding_in_haskell.ogg

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 forwarding.
	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 rejected
	Merge the remote changes (e.g. 'git pull') before pushing again.  See the
	'Note about fast-forwards' section of 'git push --help' for details.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the vcs-home mailing list