If you have created various pieces of code (shell scripts, conky config, etc.), you may want a way to maintain/backup them. One very common way to do so is to use a git
server.
You can use one of the many git repositories on the internet, or create a local one.
This short guide walks you through setting up a local git
server, which can then be integrated into whatever backup strategy you have. This ensure that all revisions/changes are backed-up as well, not just the latest versions of the files.
This example assumes the following:
- A directory named
/development/repo1
contains the code to be maintained - A directory named
/server
will contain the local repo - Existing folder contents should be pushed to the new git repo
1 | GIT_DIR=repo1 |
Install GIT Server
1 | sudo apt install git |
Server Setup
1 2 | cd /server/${GIT_DIR} git init --bare |
Client Folder Setup
1 2 3 4 5 6 | cd /development/${GIT_DIR} git init git add -a git commit -m "Initial repo" -a git remote add origin /server/${GIT_DIR} git push origin master |