Setting Up a Bare Git Repository

At the Repository:

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.

At the Work Folder:

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

Troubleshooting

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:

  1. Set the repository to bare:
    git config --bool core.bare true
  2. Delete all files in the repository folder except for the .git folder.

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 Rejected

Conclusion

After 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.