Linked Questions
30 questions linked to/from How to ignore certain files in Git
1 vote
1 answer
8k views
How can I commit only specific files in Git? [duplicate]
If there are 1000 files in my local repository, and I want to commit and push only 700 files, is there a possibility?
0 votes
2 answers
2k views
How to make Git automatically ignore certain files when I'm staging changes? [duplicate]
I have a folder in my Git directory that stores information about when my program runs and I don't want this information to keep getting added to the repo. Currently I just avoid selecting files from ...
0 votes
1 answer
3k views
Github for Windows ignoring .gitignore file [duplicate]
I'm trying to get my .gitignore to ignore everything except my src files in my NetBeans project. My gitignore looks like this nbproject/private/ build/ nbbuild/ dist/ nbdist/ nbactions.xml nb-...
0 votes
2 answers
2k views
github - How to hide a single file from repository [duplicate]
Basically, I don't want my firebase credentials to show up in my github repo. This is what I have done so far. // creds.js const firebaseConfig = { apiKey: "myapikey", authDomain: &...
0 votes
1 answer
798 views
git ignore specific java class in Android Studio [duplicate]
I'd like to ignore specific java class from git. So I' posted inside root .gitignore file the full path of my desired class to ignore, but this class is still tracked by git. app/src/main/java/com/...
4056 votes
16 answers
1.3m views
Remove a file from a Git repository without deleting it from the local filesystem
I want to remove a file from my repository. git rm file_to_remove.txt will remove the file from the repository, but it will also remove the file from the local file system. How do I remove this file ...
2885 votes
21 answers
994k views
Ignore files that have already been committed to a Git repository [duplicate]
I have an already initialized Git repository that I added a .gitignore file to. How can I refresh the file index so the files I want ignored get ignored?
1423 votes
42 answers
2.1m views
How to create a .gitignore file
I need to add some rules to my .gitignore file. However, I can't find it in my project folder. Isn't it created automatically by Xcode? If not, what command allows me to create one?
258 votes
10 answers
110k views
How do you make Git ignore files without using .gitignore?
Due to external weird constraints I cannot modify the .gitignore of my repository. Is there a way to ignore files and directories other than modifying a .gitignore? Even if it is a global solution ...
105 votes
2 answers
95k views
Ignoring a directory from a Git repo after it's been added
I've learned how to exclude an entire directory in git (add a line bin/ to .gitignore). And I've learned how to ignore files "after the fact" (i.e. after they have been added to git): git rm --cached ...
4 votes
3 answers
1k views
Only push certain files once
I have a git repository for a server. That server needs some files, but these files only have to be pushed once. So when someone edits it, then it doesn't have to be pushed to github, but when someone ...
1 vote
3 answers
3k views
.NET project--should .dll and .pdb file be included in version control?
I'm working on a .NET project with Visual Studio and it's Git extension. Until recently, the whole bin folder was excluded from version control in the .gitignore file. It is now included because of ...
2 votes
1 answer
5k views
How to remove (not ignore) specific files using .gitignore?
Below is the image of my project structure: I would like to delete .vs folder, packages folder, .hgignore file and bin and obj directories under Leapfrog.Datafetcher, Leapfrog.Test, and src/...
0 votes
2 answers
2k views
Where to store my API key in an open source Python Script
So I'm working on with an api from IsThereAnyDeals and I'm wondering where I should store my API key? Is it possible to store it remotely or is it fine to just store it inside the script?
0 votes
3 answers
2k views
Setup the git properly to ignore unwanted files
I check out a branch locally and worked with 2 files, say, their names are A.java and B.java. Then, I add and commit to the commands i.e. git add ., git commit -m "some msg". Eventually, I push them ...