Git + Smart HTTP Issues (can't push / pull)

I have used SVN for many years, but I want to test Git for the first time.

I tried using the HTTP protocol to save my previous credentials (made using htpasswd).

I performed this procedure on my server:

$ aptitude install git-core apache2
$ mkdir -p /var/git/repositories
$ htpasswd -c /var/git/passwd my_account
$ cat > /etc/apache2/sites-available/git << EOF
<VirtualHost *:80>
    ServerName git.mydomain.com

    SetEnv GIT_PROJECT_ROOT /var/git/repositories
    SetEnv GIT_HTTP_EXPORT_ALL
    SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER

    ScriptAlias / /usr/lib/git-core/git-http-backend/

    DocumentRoot /var/git/repositories

    <Directory /var/git/repositories>
        Options +ExecCGI +SymLinksIfOwnerMatch -MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    <Location />
        AuthType Basic
        AuthName "Git Access"
        AuthUserFile /var/git/passwd
        Require valid-user
    </Location>
</VirtualHost>
EOF

$ a2ensite git
$ service apache2 reload

$ cd /var/git/repositories
$ git init --bare my_project.git
$ git update-server-info

On my client, I do this:

$ git clone http://git.mydomain.com/my_project.git
$ cd my_project
$ cat > test-file.txt << EOF
This is a test
EOF
$ git add test-file.txt
$ git commit -m "My first commit"

Everything seems to be in order now.

How I want my content to be updated by my remote repository, I do git pull, but it does not work. Git returns the following message:

Your configuration indicates a union with ref 'master' from remote, but such a reflector was not received.

In any case, I was left alone in my code. I will try to fix it later. Try clicking on the server.

So, I do git push.

; . , , ​​ "".

... " ", " "?

, : git push origin master :

: :
http://git.mydomain.com/my_project.git
! [remote reject] master → master (n/a ( ))
error: " http:// git.mydomain.com/my_project.git '

.

, , , .

, .

EDIT:

, http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html

gitweb. HTTP- Git.

, :

<VirtualHost *:80>
    ServerName git.mydomain.com

    SetEnv GIT_PROJECT_ROOT /var/git/repositories
    SetEnv GIT_HTTP_EXPORT_ALL
    SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER

    ScriptAlias / /usr/lib/git-core/git-http-backend/

    DocumentRoot /var/git/repositories

    <Location />
        AuthType Basic
        AuthName "Git Access"
        AuthUserFile /var/git/passwd
        Require valid-user
    </Location>

</VirtualHost>

.

git pull :

ref 'master' , .

git push origin master :

: : unpack-objects http://git.mydomain.com/my_project.git! [remote reject] master → master (n/a ( )) error: "http:// git.mydomain.com/my_project.git '

+3
1

, , , , cgi. root sudo. ( , .) Ex debian:

#!/bin/sh

apt-get install git-core
apt-get install curl-ssl
a2enmod cgi
a2enmod alias
a2enmod env

, apgi cgi. apache cfg , script , root, , . . Smart GIT HTTP ubuntu. Debian, Apache URL-.

git init --bare. README, GIT HEAD. git init, GIT .git/ . GIT init --bare . GIT . , :

#!/bin/sh

echo >> '' README
git init
git add .
git commit
git log --oneline --decorate --graph
0

All Articles