Hi there.
I want to set up a primary bare Git repository and two local repositories which will occasionally push data into the primary repository.
I did the following on the primary server called githost:
On the local server called taz-x10:
The repository is empty. Why? Then I tried to push files into the bare repository from the local repository:
What am I doing wrong?
I want to set up a primary bare Git repository and two local repositories which will occasionally push data into the primary repository.
I did the following on the primary server called githost:
Code:
[/dev/pts/1]termit@githost:~> mkdir gitdir
[/dev/pts/1]termit@githost:~> cd gitdir/
[/dev/pts/1]termit@githost:~/gitdir> echo "bla" > file1; echo "blabla" > file2; echo "testbla" > file3
[/dev/pts/1]termit@githost:~/gitdir> ls
total 6
-rw-r--r-- 1 termit wheel - 4B Jul 25 11:20 file1
-rw-r--r-- 1 termit wheel - 7B Jul 25 11:20 file2
-rw-r--r-- 1 termit wheel - 8B Jul 25 11:20 file3
[/dev/pts/1]termit@githost:~/gitdir> git --bare init
Initialized empty Git repository in /usr/home/termit/gitdir/
Code:
[termit@taz-x10 ~]$ git clone ssh://githost:1122/usr/home/termit/gitdir
Cloning into 'gitdir'...
Password:
warning: You appear to have cloned an empty repository.
Checking connectivity... done
Code:
[/dev/pts/2]termit@taz-x10:~> mkdir gitdir
[/dev/pts/2]termit@taz-x10:~> cd gitdir/
[/dev/pts/2]termit@taz-x10:~/gitdir> echo "bla" > file1; echo "blabla" > file2; echo "testbla" > file3
[/dev/pts/2]termit@taz-x10:~/gitdir> git init
Initialized empty Git repository in /usr/home/termit/gitdir/.git/
[/dev/pts/2]termit@taz-x10:~/gitdir> git add file1 file2 file3
[/dev/pts/2]termit@taz-x10:~/gitdir> git config --global user.email "you@example.com"
[/dev/pts/2]termit@taz-x10:~/gitdir> git config --global user.name "Your Name"
[/dev/pts/2]termit@taz-x10:~/gitdir> git commit -m "test"
[master (root-commit) e99673a] test
3 files changed, 3 insertions(+)
create mode 100644 file1
create mode 100644 file2
create mode 100644 file3
[/dev/pts/2]termit@taz-x10:~/gitdir> git push ssh://githost:1122/usr/home/termit/gitdir
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Password:
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'ssh://githost:1122/usr/home/termit/gitdir'