Question: I had implemented my project along with daily commits to Github, which is a website implemented using Flask and Python, while daily commits I used to `git add --a`, thus it has added all folders like `__pycache__` and `flask_session`. I think it is safe to delete those from my Github, Is it so? If not why?

Answer: 
If you look at [gitignore.io/python](https://www.gitignore.io/api/python), you will find in the generated .gitignore file 

```
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/

```

However, you won't find `flask_session`, not even in [`flask-common/.gitignore`](https://github.com/kennethreitz/flask-common/blob/master/.gitignore).

The [Flask documentation](https://pythonhosted.org/Flask-Session/) mentions:

> 
> `SESSION_FILE_DIR` The directory where session files are stored.  
> 
>  Default to use `flask_session` directory under current working directory.
> 
> 
> 

If that is something private to the user and the flask execution, then add to your .gitignore:

```
/*_session/

```

But considering a [Flask session](https://www.tutorialspoint.com/flask/flask_sessions.htm) stores secrets, the best practice would be to configure Flask to store its session *outside* the Git repository: that way, no risk to add by mistake anything, `.gitignore` or not.
In layman language, `YES` because these things can be generated again by Flask thus it's good practise to not push it to a repo and generate locally individually.