Ignore files in a Project to a Fork in Github - 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.

Related

How to recover files from .gitignore

while uploading files to the repository in GitHub, I accidentally click to the button to ignore the files from the upload. Now these files are in a folder called '.gitignore'.
How can I recover these files?
I'm able to see and modify them, I just want to know how to upload them in the repository.
Thanks in advance
I think you misunderstand the concept of .gitignore "folder".
It is instead a text file, with the path of the ignored directories or files.
Consider the following .gitignore file.
foo/bar.txt
foobar/
This will tell git to ignore the directory foobar as well as the file foo/bar.txt, and therefore you won't be able add the files to a commit or push it to a remote repository.
But you can simply remove a file from the list of ignored files and directories by opening the .gitignore file, deleting the line with the corresponding file and saving the .gitignore file. You then should the be able to add the file to a commit and push it to a remote repository.
More information about .gitignore can be found here

Where is the .github folder in the project repository?

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

Why does GitHub create a .gitignore folder? bug or feature?

I create a new repository (empty) using the GitHub webclient and then add a .gitignore using the Getting Started screen and choose a template.
When I commit the file, it creates the .gitignore file inside a .gitignore folder.
reponame/.gitignore/.gitignore
But when I set the gitignore with a template on the "Create a new repository" screen it will be just the .gitignore file in the root folder.
reponame/.gitignore
I'm relatively new to the gitignore concept so I would like to know, is this a bug or a feature I'm not aware of?

ignoring the build folder in an eclipse project in git repo

I am using eclipse java as an editor and would like to use the .gitignore to exclude the build folder for the project. This is what I have currently written in my .gitignore. The syntax seems to be right; I used the git documentation but I may have interpreted it wrong.
#ignoring the files within the build folder
/build/
build/**
I'm using a brand new repo so I shouldn't have any problems with already logged files in the repo.
I am trying to get git to ignore the build folder in the project file using a .gitignore. The ignore file didn't work. What could be a solution?
The way the .gitignore is written, this file needs to be in the same subfolder as the build folder, the file being ignored.

Add new folder with files to github

Probably one simple question. I pushed my first project to github. I've done it with Eclipse with EGit plugin. I've clicked on a project, chose to push remote and uploaded it to git. There I have created readme file online so the structure looks like this:
Git
-- AppFolder
------srcFolder
------libsFolder
------resFolder
------etc etc
-- Readme.md
I have one other folder with screenshots of the app which I would like to have outside my app folder. Something like this:
Git
-- AppFolder
------srcFolder
------libsFolder
------resFolder
------etc etc
-- Readme.md
-- ScreenshotsFolder
------screenshot1
------screenshot2
------etc etc
How can I accomplish that? I don't want to put that folder with screenshots to AppFolder. Thank you.
Locally, just create the ScreenshotsFolder in the same directory level as AppsFolder and README.md.
Then, git add ScreenshotsFolder will add the folder and all of its content (really, all content that is not in your .gitignore file if you have one).
Next just git commit then git push remote_repo remote_branch (ex: git push origin master).
If you aren't doing this via the command line, I'm sure the EGit plugin has some option to add the ScreenshotsFolder and do a commit then push...haven't used EGit myself, though. The steps are the same either way, just a different interface.
Are the files intended to be committed? If not, you could just .gitignore that directory.
edit: if the files are meant to be committed, why can't you just add and commit them like normal, but in new directory?