gitgithubdotfilesreadmegit-repo

How to add README.md on github but not have same README.md in home directory while using a bare git repository for managing dotfiles?


I manage my dotfiles using git in a bare repository. See article by Harfang Perch for details on this method.

It works great but I'd like to add a README.md to the root of the repository on github.

How do I add a README.md to the github repository root directory but not have that file show up in my home directories?

If I push a README.md to github then delete the README.md in my home directory this will result in

deleted:    README.md

messages from git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME status which I'd prefer to avoid.

As far as I'm aware github only renders README and README.md files in the repository root (and sub-directories but that's not relevant for this question).

I haven't seen other github dotfile bare repositories with README.md files but I've only checked 5.

Github wiki pages don't solve this problem unless there is some magic to display them in the root of the repository using a hidden .dotfile. Perhaps I'm grasping at straws but, is there any way to link and display a gist in the repository root directory on github?

I don't currently use gitlab but moving to gitlab, or a similar git hosting service, is a possibility if they have support for this that github does not.


Solution

  • You can put your README file in a .github folder and it will be automatically detected on github to be displayed on your repo main view