Where is the .github folder in the project repository? - github

I want to add a few config files to .github folder but I can't seem to find it in my repository. I do see the .git and .gitignore files. Where can I find this .github folder, Is it added by git or should I create it?

There isn't one unless you create it (and if you do, you should create it in the root directory for the repository).

Related

Github makes a repo of documents folder

My Github decided to make a repo of my whole "Documents" folder. Is there a way to disable it, because it's really annoying when working with that folder?
Delete the .git folder within Documents to remove the Git repository.

Ignore files in a Project to a Fork in Github

I want to ignore some files from a project in Github, so they don't show on my fork.
ex: README.md in another language which I won't use/update, to not show on my project when I Fork it.
Is that possible?
Add that file or directory to your .gitignore file in the root directory and make sure to commit the file.

How to make subfolders repository in Github

I've been using this folder structure where I would have one main .git folder and then have subfolders inside which doesn't have .git folder.
So as example :
Main Folder
Subfolder
Subfolder
Subfolder
Now what I want to do is, I would like to extract some of those subfolders and make them separate repositories with their histories. Which means subfolders will become a main folder as a repository. Any idea how?
The official documentation use git filter-branch.
But that or BFG are obsolete.
Use the new tool git filter-repo (directly in your regular local repository, although a backup is always a good idea before those kind of filtering)
Use a path shorcut:
git filter-repo --subdirectory-filter Subfolder1
Only look at history that touches the given subdirectory and treat that directory as the project root.
Equivalent to using --path / --path-rename /:

Configure github to use some other file as README

Because of how Eclipse and EGit organize files and directories, I have my README.md file not in the root directory of my git repository but one folder deeper. How can I tell github to show some_folder/README.md as project's readme?
In the root directory of your repo, create a folder named .github.
Create a file named README.md in this folder.
Save the relative path of the file you want to use as the repo README in .github/README.md.
This causes README.md to be interpreted as a symbolic link (symlink) file.
Example:
This repo has files named README.md and cmod-readme.md in its root directory. Normally the former would be used as the README shown on the repo's main page, but instead the latter is used.
The repo contains a .github/README.md file, which contains the relative path to cmod-readme.md, i.e., ../cmod-readme.md.
The fact that GitHub will follow symlinks when locating a repo's README doesn't seem to be documented, although the .github folder is mentioned on this page in GitHub's docs:
If you put your README file in your repository's root, docs, or hidden .github directory, GitHub will recognize and automatically surface your README to repository visitors.
It's also interesting that (based on the example repo linked above) GitHub apparently prioritizes the README.md file in .github over a file of the same name in the respository's root.
This seemed to do it for me:
https://stackoverflow.com/a/49981731/7452130
Github wouldn't interpret my .github/README.md file as a symlink unless I created a symlink on my system and then pushed it.

How to add all empty folders on git from local

How to add all empty folders on github from local
To add files we generaly use git add folder/subfolder/file.txt
but I want on folder like git add folder/subfolder/subfolder-2
You can't add an empty folder to git. Some people opt to create a .gitignore or a .gitkeep file inside the directory.