Git on Dreamhost

安装git

1
2
3
4
5
6
7
8
9
mkdir ~/src
cd ~/src
wget http://www.kernel.org/pub/software/scm/git/git-1.5.4.rc4.tar.gz
tar xzf git-1.5.4.rc4.tar.gz
cd git-1.5.4.rc4
./configure --prefix=/home/USER/ NO_CURL=1 NO_MMAP=1
make
make install
git --version

配置git库

在服务器上:

1
2
3
4
5
6
7
8
9
mkdir ~/git

mkdir ~/git/MYAPP.git
pushd ~/git/MYAPP.git
git --bare init
git --bare update-server-info
chmod a+x hooks/post-update
touch git-daemon-export-ok
popd

在本地:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mkdir repo-name.git
cd repo-name.git
git init

touch .gitignore
git add .gitignore
git commit -m "just gitignore"

git remote add origin ssh://USER@MACHINE.dreamhost.com/home/USER/git/MYAPP.git
git config branch.master.remote origin
git config branch.master.merge refs/heads/master

git push --all
git pull

参考资料: Hosting a git repository on dreamhost


Wiki首页 | 查看所有 | 编辑 | 输出到博客 | 历史版本