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

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

Related

.gitignore not ignoring a folder within a directory

It seems a straightforward one, but having researched multiple ways to do it, I can't gitignore a folder within a directory.
I have a root directory which contains all of my code in it. Because it has some back-end NodeJS stuff in it, it has a 'node_modules' folder which contains hundreds of files. As a result, when I try to upload the entire parent folder, GitHub says there's too many files to upload and tells me to reduce the number I'm uploading.
The crucial part is though, the folder has to be uploaded as a whole, as it itself is within a GitHub repository with other files with different folders in.
That means when I go onto my repository, I need this folder's files to display within the folder, and not separately within the repository. I need all of the files to be within this folder, within the parent repository, excluding the node_modules folder.
For example ->
Parent repository -> Child Directory (what I'm uploading) -> Individual files
I've tried to add the node_modules folder to my gitignore through the following methods:
Adding: node_modules/ to my gitignore file
Writing: echo node_modules >> .gitignore through my terminal
Adding a separate gitignore file within my node_modules file with a * in it
None of them have worked and I can't find any other solutions. For reference I'm using a Mac.
Does anyone have any idea what I'm doing wrong, or how it'd be best to do it?
By default, you do not need to include the node_modules folder in your repositories because the package.json file contains all of your project's dependency information. This means that anyone who clones your repository can run npm install and have the entire node_modules folder without problems.
To solve this you can create your own .gitignore file, creating a new file at the root of your project and renaming it to .gitignore (writing exactly that way). Then you can open it with any text editor and add */node_modules to one of the lines.
This will likely solve your problem.

How to ignore an extension file in entire app except a particular folder

I have a requirement in my project where I need to ignore the .html file to track via git in the project however need to track any .html file in a given folder along with its sub folder.
I tried using below code to exclude to track all files from ignore_directory but it didn't worked.
*.html
!ignore_directory/*
What you have is the correct way to exclude a directory.
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor or
# operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
*.html
!ignore_directory/*
Either the path you have is incorrect or is not relative to the directory you want to exclude. It's also possible that the directory you want to exclude contains a gitignore file overriding your exclusion.
Read GitHub help on Ignoring files for a simple introduction to ignoring files and also tead the Git - gitignore documentation.

Ignore everything expect all subfolders / files in .gitignore

I want to allow all files (and their parent folder) within a specific directory of my eclipse project.
I want to allow all files within the libs folder
Example
RootFolder
EclipseProjects
ProjectOne
build
src
WebContent
libs
lib1
file.jar
file1.jar
lib2
file3.jar
file4.jar
etc.jar
In the root of git I have my .gitignore, which includes many variations on the same folder/files
I'm trying to just allow the jars to see if that will work too.
#Relevant lines of .gitignore
#Ignore
*.jar
#Allow
!libs/
!libs/*
!libs/*/*
!libs/**.jar
!/libs/
!/libs/*
!/libs/*/*
!/libs/**.jar
!libs/lib/*.jar
I cannot get this to work, any suggestions?
This worked for me
!**/libs/**/*

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.

Eclipse svn move/rename doesn't work on all-lowercase filenames?

I am renaming a series of .js files using Refactor -> Rename.
They all work except when I rename a file to an all-lowercase name (i.e. rename Calendar.js to calendar.js). I get this error:
move C:/Users/JohnDeer/workspace/MyApp/WebContent/scripts/ui/Calendar.js C:/Users/JohnDeer/workspace/MyApp/WebContent/scripts/ui/calendar.js
Path is not a working copy directory
svn: Path 'C:\Users\JohnDeer\workspace\MyApp\WebContent\scripts\ui\calendar.js' is not a directory
I checked the ui folder and there is a .svn folder in it.
I think the problem is that file names are not case sensitive in Windows. So the lowercase name registers as the original name and maybe when the source file is the same as the destination, the latter is understood as a directory.
As a workaround you can try to use a temporary intermediate file:
rename Calendar.js to tmp.js
then rename tmp.js to calendar.js
Another possibility is to rename the file in the repository by hand (this can be done using Eclipse's Repository Browsing View as well as from the command line) and then update the project.