Using your own Debian server to host a Git revision control repository can be fairly easy. Instead of relying on services like Github you simply log on to your command shell and install the git package which should be waiting for you there already.
sudo apt-get install git
After the package has been installed successfully you may want to create a new user who can access your Git repositories. Also add a bash so you can ease up further configurations for the time being.
sudo useradd -m -d /var/git -s /bin/bash -c 'Git' git
In order to save SSH keys for authorized users you wwitch to git role and store an authorized_keys file in you Git .ssh directory. Make sure only “Git” is allowed to read this folder and that only one SSH key per line is valid.
chmod 700 /var/git/.ssh
You got yourself now an up and running Git server.
In case you want to migrate your existing repositories from GitHub to your new server you can do so by executing…
git --bare fetch https://firstname.lastname@example.org/username/repository-name.git master:master
… where of course username needs to be replaced by your actual GitHub username as well as respository-name by the respective GitHub repository name.