أعجوبة

البرمجيات الحُرة والمفتوحة المصدر

أدوات المستخدم

أدوات الموقع


pri:git

اختلافات

عرض الاختلافات بين النسخة المختارة و النسخة الحالية من الصفحة.

رابط إلى هذه المقارنة

جانبي المراجعة السابقةالمراجعة السابقة
المراجعة التالية
المراجعة السابقة
pri:git [2010/09/01 14:51] alsadipri:git [2015/04/23 03:21] (حالي) – تحرير خارجي 127.0.0.1
سطر 1: سطر 1:
 +====== إدارة git ======
 +===== الأدوات =====
 +نحن نستخدم gitosis  لإدارة الصلاحيات والمستودعات موجودة في
 +الموجود في /home/gitosis/repositories  لكن المستخدم gitosis ليس داخل chroot
 +  * http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
 +  * http://www.perevillega.com/installation-guides/gitosis-git-repository/
 +  * http://www.urbanpuddle.com/articles/2008/07/11/installing-git-on-a-server-ubuntu-or-debian
 +
 +ونستخدم cgit الموجود في /home/ojuba_org/cgit_public_html/  داخل chroot
 +
 +ولقد أضفنا git-daemon
 +
 +===== طريقة إضافة مشروع جديد =====
 +أولا نعمل git clone أو pull ل gitosis-admin.git وتعديل الصلاحيات وخيارات العرض. ثم git commit ثم git push
 +
 +ثانيا عمل المستودع أو ال initial commit
 +<code bash>
 +repo=myproj
 +mkdir $repo
 +cd $repo
 +git init
 +git remote add origin gitosis@ojuba.org:${repo}.git
 +# do some work, git add and commit files
 +git commit -m 'initial commit'
 +git push origin master:refs/heads/master
 +</code>
 +
 +ثالثا: السماح cgit بعرضها وعمل about.html عبر تحرير
 +  /home/ojuba_org/.unweb/cgitrepos.conf 
 +
 +يتم وضع صفحة about في
 +  /home/gitosis/repositories/${repo}.git/info/web/about.html
 +
 +وإن احتجنا للصور يمكن وضعها في
 +
 +  /home/ojuba_org/cgit_public_html/cgit-data/$repo/
 +
 +رابعا: السماح ل git-daemon بتصديرها عبر وضع ملف
 +
 +  /home/gitosis/repositories/${repo}.git/git-daemon-export-ok
 +
 +ويمكن عمل ذلك تلقائيا عبر تنفيذ 
 +
 +  /home/admin/.unweb/git-export.sh
 +
 +
 +===== الانتقال إلى gitolite =====
 +
 +<code bash>
 +cd hijra
 +git pull
 +git remote rm origin
 +git remote add origin gitoj@ojuba.org:hijra.git
 +git push origin master:refs/heads/master
 +</code>
 +
 +بعدها يمكن التحقق من ذلك عبر
 +<code bash>
 +[alsadi@localhost hijra]$ git remote show origin
 +* remote origin
 +  Fetch URL: gitoj@ojuba.org:hijra.git
 +  Push  URL: gitoj@ojuba.org:hijra.git
 +  HEAD branch: master
 +  Remote branch:
 +    master tracked
 +  Local ref configured for 'git push':
 +    master pushes to master (up to date)
 +</code>
 +
 +بعدها تم رفع ملف إعدادات جديد إلى gitolite-admin ثم تنفيذ السكربت التالي
 +<code bash migrate.sh>
 +#! /bin/bash
 +
 +for b in ../git-repos/*.git
 +do
 +bare=`basename "$b"`
 +repo=`basename "$b" .git`
 +
 +[[ "$repo" == "gitosis-admin" ]] && continue
 +
 +git clone "$b"
 +
 +pushd $repo || exit 1
 +git remote rm origin
 +git remote add origin gitoj@ojuba.org:$repo.git
 +git push origin master:refs/heads/master
 +git push --tags
 +popd
 +
 +done
 +</code>
 +
  
pri/git.txt · آخر تعديل: 2015/04/23 03:21 بواسطة 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki