#Create the user's public key
- $ssh-keygen -t rsa (default output path ~/.ssh/id_rsa.pub, rename it to new_user.pub)
- git config --global user.email "Email"
- git config --global user.name "Your Name"
#Add the key to gitolite (gitolite recommends to use method 2)
- Method 1 - server side (@git~)
- copy new_user.pub to server's /home/git/publickeys
- $gitolite setup -pk publickeys/new_user.pub
- Method 2 - client side (a client which is already added to the git server, and have read rights to gitolite-admin)
- $git clone git@git.actatekrd.com:gitolite-admin
- $git add keydir/new_user.pub
- $git commit -m 'add users: new_user'
- $git push
#Remove a user
- $git rm keydir/new_user.pub
Setting up a remote repository and doing an initial “push”
#Create the new repo directory ssh to git server (from a client which had NOT added key git server)
$ssh git@git.actatekrd.com (password:git)
or direct run the below commands on git server
- $cd /home/git/repositories
- $mkdir my_project.git
- $cd my_project.git
- $git init --bare
- $git update-server-info (If planning to serve via HTTP)
From a client which is already added to the git server and have read rights to gitolite-admin
create ‘config’ file under ~/.ssh
host git
user git
hostname git.actatekrd.com
- git clone git@git.actatekrd.com:gitolite-admin
- edit gitolite-admin/conf/gitolite.conf, add access rights of the new repo to users
- cd my_project
- git init
- git add *
- git commit -m "My initial commit message"
- git remote add origin git@git.actatekrd.com:my_project.git
- git push -u origin master
create ‘config’ file under ~/.ssh
host git
user git
hostname git.actatekrd.com
沒有留言:
發佈留言