在Ubuntu架git的筆記
a. Install Environment
     1. Ubuntu 12.04.1
 
b. Install Git
     1. apt-get install update
     2. apt-get install git-all
 
c. Create git folder location (e.g.: /data/git)
     1. mkdir /data/git
 
d. Create repository location
     1. mkdir new_project
     2. cd new_project
     3. git init
     4. cp file to new_project folder
     5. git add .
     6. git commit -m "import" .
     7. chmod -R 777 .git
     8. nano .git/config
     9. cd..
    10. ./create_git_link.sh new_project
 
e. Remote by SSH
     1. apt-get install ssh
     2. ssh account@ip/data/git/folder
 
f. .git/config
     [core]
               repositoryformatversion = 0
               filemode = true
               bare = true
               logallrefupdates = true
               shareRepository = true
     [receive]
               unpackLimit = 1
 
g. create_git_link.sh
     #!/bin/sh
     echo "Project name $1"
     echo "Create Git Link"
     mkdir /var/cache/git/$1/
     ln -s /data/git/$1/.git /var/cache/git/$1/.git
     sv restart git-daemon
 
h. Check on gitweb
     Local: localhost/gitweb
     Other: ip/gitweb
arrow
arrow
    文章標籤
    git gitweb
    全站熱搜

    scarletdream 發表在 痞客邦 留言(0) 人氣()