Difference between revisions of "Migration from Bitbucket to a local git repository"

From wiki.ferrari.mo.it
Jump to navigation Jump to search
Line 2: Line 2:
  
 
== Server side ==
 
== Server side ==
 +
 +
Install needed packets
  
 
  apt-get install git
 
  apt-get install git
 
  apt-get install git-server
 
  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.

Revision as of 17:49, 18 March 2026

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.