Gitignore doesn't ignore filename that has same name as parent folder - gitignore

Folder name is
HDWLighting/AUTOSAVE
and in the AUTOSAVE folder is a filename called AUTOSAVE.d3p, so the path is
HDWLighting/AUTOSAVE/AUTOSAVE.d3p.
The .gitignore ignores all files in AUTOSAVE folder except AUTOSAVE.d3p
In my master .gitignore file located in
HDWLighting
I've tried the following:
AUTOSAVE/
AUTOSAVE/*
AUTOSAVE/**
I have even put a .gitignore file in the
HDWLighting/AUTOSAVE
directory which simply has:
*/*
but this fails to ignore the AUTOSAVE.d3p file as well...
The expected results are to ignore the AUTOSAVE.d3p file but instead I am getting the message "The binary file has changed" in github desktop.

Related

When I push a cpp file to the github repository then an exe file gets added. What can I do so that I don't get those exe files

Whenever I push a cpp file to my github repository an exe file gets added to the repository. I don't want that exe file.How to do that?
you want the file not be tracked across everyone's repositories create a pattern as below in .gitignore file. This file can either be in root directory of you application or a the directory you .cpp and .exe files are in.
*.exe
If you want .exe files to be ignored for only you. Then you can put above pattern in .git/info/exclude
Follow this link for more info:
https://www.atlassian.com/git/tutorials/saving-changes/gitignore

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

How to exclude path on the deployment in PhpStorm from .gitignore

I always need to exclude all the path defined in the .gitignore file when I synchronize the server with the deployment feature of PhpStorm.
There is a way to copy these path and exclude them without manually exclude them one by one?
I'm searching like a configuration file or somewhere to put a list of directory and files like in the .gitignore file

Does sourcetree automatically load .gitignore file?

I create .gitignore file by textedit on mac.
( by following Adam of link Git ignore file for Xcode projects I create empty txt format file, and copy and paste it.)
And I put that file in .git folder in the project folder.
Then, Does sourcetree will 'automatically' load this .gitignore file as soon as I put the file in that folder ?
Put it directly in the project folder not to .git. It will be automatically loaded by sourcetree from that folder

Gitignore Ignore all file except for the files inside a subdirectory

I want to add a rule to ignore all apart from the files within a 'Build' folder, but not the folder itself.
I currently have the below which ignores all but the Build folder, but I want only the files within the Build folder, ignoring the folder itself.
# Ignore everything in the root except the Build directory.
/*
!.gitignore
!Build/
It doesn't matter, because git doesn't track folder, only their content.
And if their content is ignored or empty, you won't be able to add their folder, even if that folder is displayed in git status as "untracked".
If Build as some content which isn't ignored, you will be to add said content with the shortcut git add Build: that doesn't mean Build/ is "ignored" or "not ignored": it is just a container.