Related Pages
Git - How to use Git.
useradd gitrepo echo "gitrepo:gitrepo" |chpasswd
su - gitrepo mkdir test1.git cd test1.git git init --bare --share
mkdir test1 cd test1 git init echo "git test" > readme git add . git commit -m "first commit" git remote add origin ssh://x.x.x.x/home/gitrepo/testproject.git git push origin master
git clone ssh://x.x.x.x/home/gitrepo/test1.git echo "test" >> readme git add . git commit -m "change test" git push origin master git status
Reference : 4.6 Git on the Server - Smart HTTP
cd /opt/git git init --bare --shared project.git chown -R apache:apache project.git
SetEnv GIT_PROJECT_ROOT /opt/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
RewriteEngine On
RewriteCond %{QUERY_STRING} service=git-receive-pack [OR]
RewriteCond %{REQUEST_URI} /git-receive-pack$
RewriteRule ^/git/ - [E=AUTHREQUIRED]
<Files "git-http-backend">
AuthType Basic
AuthName "Git Access"
AuthUserFile /opt/git/.htpasswd
Require valid-user
Order deny,allow
Deny from env=AUTHREQUIRED
Satisfy any
</Files>
htpasswd -c /opt/git/.htpasswd user01
git clone http://x.x.x.x/project.git . ls project
Related Pages
Git - How to use Git.