cancel
Showing results for 
Search instead for 
Did you mean: 

.gitignore - how to include path in excluded folder?

.gitignore - how to include path in excluded folder?

I have my first magento project

I want to exclude from tracking folder:

app/ --- this where the repo starts

And Inculde path: app/frontend/design/newziw/default

I think I will go crazy in a second Smiley Very Happy please help me out guys

2 REPLIES 2

Re: .gitignore - how to include path in excluded folder?


@Tom wrote:

I have my first magento project

I want to exclude from tracking folder:

app/ --- this where the repo starts

And Inculde path: app/frontend/design/newziw/default

I think I will go crazy in a second Smiley Very Happy please help me out guys


app/*

!app/frontend/design/newziw/default

 

The difference is between app/ and app/* 

with app/ git will not look in the folder at all

with app/* git will look under app and ignore everything there 

now the rule :

!app/frontend/design/newziw/default

works 

Re: .gitignore - how to include path in excluded folder?

To exclude the app/ folder from tracking, you can create a file called .gitignore in the root directory of your project if it doesn't already exist, and add the following line to it:

bash
Copy code
/app/
To include the app/frontend/design/newziw/default folder, you can add the following line to the .gitignore file:

javascript
Copy code
!/app/frontend/design/newziw/default/
This will exclude all files and folders inside app/ except for the app/frontend/design/newziw/default/ folder.

 

Regards,

Rachel Gomez