Visual Code and local ssh based git

Last Updated or created 2023-04-20

I’ve gone back and front using Visual Code.
For work and now with platformio.
(I’ve been using platformio on the commandline only, until recently.)

While i have some private github/gitlab accounts, I alway had some local git repositories.
Using in the past GiTea, and a ssh based one.

Below: This own hosted SSH setup allows me to use Visual Code to use as git repository

========== On you ssh server

adduser git
su - git
mkdir .ssh && chmod 700 .ssh
touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
chsh git -s $(which git-shell)
# Note .. there is no interactive shell! 

== locate git-shell-commands 
locate git-shell-commands
cp -r /usr/share/doc/git/contrib/git-shell-commands /home/git/
chmod +x /home/git/git-shell-commands/*

== Make sure git-shell is in /etc/shells

== Make a git repo destination

mkdir -p /mygitstuff/git
cd /mygitstuff/git
mkdir project.git
cd project.git
git init --bare

========== On your workstation

== copy ssh public key in .ssh/authorized_keys on the server

cd myproject
git init
git add .
git commit -m 'Initial commit'
git remote add origin git@gitserver:/mygitstuff/git/project.git
git push origin master

Leave a Reply

Your email address will not be published. Required fields are marked *