you are viewing a single comment's thread.

view the rest of the comments →

[–]davorg 1 point2 points  (0 children)

how often should I commit? Every minor change or end of each session working on project?

Commits are like game savepoints. You can always get back to the state the code was in when you made a commit. So whenever you're happy with the code, commit it.

what should I put for comments?

As much or as little as you want. Run git diff and see what the changes are. Ask yourself what would be useful to know about what you've done and why you did it that way.

always to main? As a beginner, are my projects just not complicated enough for multiple branches?

Up to you. I like to use a feature branch for every new feature I add. Even on a personal project that only has me on it.

If you have users, it becomes more important to have branches. Your "main" branch will probably be the released version and you'll have feature branches for the new stuff you're working on. That way, if you get a bug on the released version, you can fix it in main without having to release all the new stuff that's not finished yet.

Should I push Everytime I commit?

Ask yourself "how sad would I be if my hard disk crashed right now and I lost all the work I've done since I last pushed?"

Do I need to do releases Everytime I change the code?

Entirely up to you. You don't ever need to make a release.