What should we include in our .gitignore file?

I have the following in my gitignore. Are these recommended? They seem specific to my workspace.

_pgbackup
_pginfo
pinegrow.json
2 Likes

Thatā€™s my list as well :+1:t4:

1 Like

I have:

/node_modules
/_pgbackup
package-lock.json
.DS_Store

I keep _pginfo and pinegrow.json, but Iā€™m interested in understanding your reason for ignoring them.

1 Like

Because they change with every commit. I have yet to work on a Pinegrow project with another dev but my assumption is that itā€™s to do with my personal setup of Pinegrow and not necessary. Thatā€™s what I wanted clarification on.

On another note, why are you ignoring package-lock? You shouldnā€™t ignore package-lock.json.

1 Like

Thanks for the info about package-lock.json ā€“ I learn something new every day!

I keep pinegrow.json since it holds configuration information or my project and theme. Without it, my WordPress and TailWind theme settings get all mucked up. I havenā€™t tried excluding _pginfo yet, but since it holds my class tracker, Iā€™m hesitant to exclude it.

1 Like

If you also use VSCode you might want to put .history in there too

1 Like

Iā€™ve not seen this. Is this something Pinegrow creates? because FYI, my .gitignore is much bigger than Iā€™ve show, Iā€™m just focusing on Pinegrow files.

Ignore if you donā€™t use the history plugin in VSCode

  1. We include _pgbackup in our .gitignore because this folder expands quickly and is not critical. We consider these files temporary. Also, I just tested the Visual Code extension ā€˜Local Historyā€™ suggested by @jcamachott and have now added .history to our .gitignore. Great recommendation!

  2. We agree with @adamslowe for tracking pinegrow.json. We enter !pinegrow.json expressly in .gitignore to point out that this file needs to be tracked. We have found that this file holds configuration information for our projects and themes.

  3. We also expressly track projectdb.pgml (i.e., !projectdb.pgml). Pinegrow states explicitly, ā€œThe style definitions are kept in projectdb.pgml file. Itā€™s recommended to keep this file under source control.ā€ Source: Class styles | Pinegrow Web Editor

  4. Furthermore, we expressly track _pginfo/ (i.e., !_pginfo/). Based on our research, similar to @adamslowe, this folder contains critical files (i.e., fonts.json) needed by the Pinegrow project.

  5. We also do not track node_modules as @adamslowe stated. This folder is used to download dependencies. The contents of this folder can be recreated.

  6. Weā€™ve also added to .gitignore the _pgexport/ folder as we consider this folder and its contents temporary. This directory can be recreated by performing another export from the Pinegrow project. Pinegrow uses this folder based on our review to build the export and then copy the files to the final destination set under Pinegrowā€™s ā€˜WordPress Theme Settings,ā€™ either the Theme or Plugin folder. Are there any files saved to _pgexport/ that Pinegrow cannot recreate? Any other reason to track _pgexport/?

3 Likes

This is fantastic. It has already become useful and Iā€™ve implemented. Cheers @mickythompson

2 Likes