Migration from Bitbucket to a local git repository

From wiki.ferrari.mo.it
Jump to navigation Jump to search

Migrate form a remote (e.g. Bitbucket) to a local git server

Server side

Install needed packets

apt-get install git
apt-get install git-server

Create user git (and certificate)

adduser git
mkdir /usr/local/git/
chown git:git /usr/local/git

Certificate

cd /home/git/
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout ./git.key -out ./git.crt
cat git.key > /home/git/.ssh/authorized_keys

Then, edit authorized_keys this way:

no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa
KEY gsg-keypair

Note: KEY is the generated key, without the header and the footer.

Init repositories:

git init --bare eywa-3.git

Client side