freebsd上安装git(2)
本文转载自: http://cni.stanford.edu/wiki/Git
Git
We are using gitosis to manage our git repositories on nims.
Contents[hide] |
initial client configuration
IMPORTANT: This needs to be done on each machine you are planning to use git from.
git config --global user.name "YOUR NAME" git config --global user.email [email protected] git config --global color.ui auto git config --global core.excludesfile '~/.gitignore' cat << EOF >> ~/.gitignore .DS_Store .*.swp .sconsign.dblite *.[ao] *.so *.py[co] EOF
creating a new repository
- Get an up-to-date version of the gitosis-admin repository by cloning or pulling.
- Configure gitosis.conf according to your needs. Add ssh keys as necessary. Commit and push gitosis-admin.
- Set up a new repository on your local machine and push it to the host server.
mkdir PROJECT && cd PROJECT touch README.txt git init && git add . && git commit -m 'initial commit' git remote add origin [email protected]:PROJECT.git git config branch.master.remote 'origin' git config branch.master.merge 'refs/heads/master' git push origin master
From now on, a simple git push
will be enough.
cloning an existing repository
git clone [email protected]:PROJECT.git
E.g.,
git clone [email protected]:ge.git git clone [email protected]:arduino.git
After this, git push
and git push
will work.
gitosis on FreeBSD
## http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way ## http://eagain.net/gitweb/?p=gitosis.git;a=blob_plain;f=README.rst;hb=HEAD ## on server portmaster devel/py-gitosis # devel/git: disable P4, CVS, CURL su - git gitosis-init < /tmp/id_rsa.pub # this is your public key; or paste at prompt, then enter ## on admin client git clone [email protected]:gitosis-admin.git cd gitosis-admin && vim gitosis.conf # add your project(s) and users git mv keydir/user.pub keydir/newuser.pub # if you don't like the default; must match gitosis.conf git add keydir/anotheruser.pub # the public ssh key of another user git commit -a -m 'adding new projects' && git push
Now you can simply push and pull repositories according to the rules described in gitosis.conf.
相关推荐
formula 2020-11-12
huhongfei 2020-11-05
乾坤一碼農 2020-10-27
liumengyanysu 2020-10-22
E哥的aws认证攻略 2020-10-15
tianyafengxin 2020-10-08
guying 2020-10-05
好脑筋不如烂笔头 2020-09-17
nebulali 2020-09-11
佛系程序员J 2020-09-15
fenggit 2020-09-15
JustHaveTry 2020-09-11
兄dei努力赚钱吧 2020-09-06
IngeniousIT 2020-08-25
liumengyanysu 2020-08-17
guying 2020-08-16