How to preserve changes in the editor

As the title, I use .gitignore which ignore build/ save/ intermedia/. I just wonder how I can save changes made in editor in source control.

Thanks.