git init
git config --bool core.bare true
This initializes the repository and sets it as a bare repository, which does not include a working directory.
Add the remote repository:
git remote add origin git:/home/git/send-listen
Push to the remote repository, setting the upstream branch:
git push --set-upstream origin master
Additional setup example:
git remote add origin /home/git/multiseed-utils
git push --set-upstream origin master
If you encounter an error such as "remote rejected master master branch is currently checked out", you can resolve it by converting your remote repository to a bare repository. This involves the following steps in your remote repository:
git config --bool core.bare true
This configuration change allows you to push to the repository without errors because a bare repository does not have a checked-out working tree.
For more information, visit this Stack Overflow discussion:
Git Push Error: Remote RejectedAfter these steps, your remote repository should no longer be empty, and you should be able to push changes without encountering the typical errors associated with non-bare repositories.