How to add /logs to .gitignore

I’m running ghost locally and saving my work to GitHub. In the past, I’ve had issues with logging, namely when I’ve had different branches and trying to merge.

While I’ll be more careful now, I’d like to just ignore the log folder all together.

I want to confirm that to do this, I’d create a .gitignore file in my root directory and then add:

# Ignore /logs folder
content/logs

These two .log files under the /logs folder have given me issues in the past:
content\logs\http___localhost_2368__development.error.log
content\logs\http___localhost_2368__development.log

Are there any others that I don’t know of that I should include?

If you’re developing a theme, you don’t need to track your entire Ghost instance with Git, just the theme folder :slight_smile: Otherwise, GitHub isn’t a great option for tracking changes to your Ghost instance since most of the content will be binary data (sqlite3 is a binary database, and images are binary). Your best bet is to set up a recurring job to make a backup

1 Like

Thanks @vikaspotluri123. I totally get it now. I set up a continuous integration of my Ghost theme using GitHub & Git Actions (documentation found here).

1 Like