Here, this is what I use on a daily basis when I try to avoid online services such as Github, Gitlab... Of course when I don't need the CI/CD and the bells and whistles such as actions, accounts, etc.
This answer is for future reference regarding how to achieve a full Git workflow without relying on a remote Git hosting service (like GitHub, GitLab, etc.), by using a local bare repository as your "remote."
You can replicate the standard Git workflow (clone, commit, push, pull, etc.) entirely on your local machine by setting up a bare repository to serve as your central, shared history.
First, create a bare Git repository in a designated, central location on your machine. This directory will not contain a working tree (i.e., no files, just the Git history).
Pick a directory for your bare repo (e.g., in your home directory).
Bash
mkdir ~/my-project-bare.git
cd ~/my-project-bare.git
git init --bare
Now, treat that bare repository path as the "remote URL" and clone it into your actual working directory.
Move to a different location where you want your project files to reside.
Bash
cd /path/to/my/development/area
Clone the local bare repository using its file path.
Bash
git clone ~/my-project-bare.git my-project-working
cd my-project-working
From this point on, all Git operations are exactly the same as if you were using an external remote.
Configure your identity (optional, but good practice):
Bash
git config user.name "Your Name"
git config user.email "[email protected]"
Add, commit, and push changes:
Bash
# Make changes to files...
git add .
git commit -m "Initial commit of the project setup"
git push origin master # or main
The ~/my-project-bare.git directory now acts as your central source of truth. If you want to simulate multiple developers or different machines, you can simply clone the bare repo again into a different folder (e.g., my-project-testing), and use git pull and git push between the working clones and the bare repo.