Good practices and workflow
A few guidelines and workflows are discussed below, in order to uphold good practice with Git:
- Always maintain a separate branch for whatever thing you're doing. Now, when you would like to merge your changes back into main, simply do a Git Merge.
- Keep your branch up-to-date, if possible, which involves checking out or pulling changes.
- Branches can be pushed up to the origin. There are a few reasons for this. First, if your workstation crashes, you don't lose your changes—one of the primary reasons for a VCS. Second, other developers can quickly switch to your branch if needed.
- Commit your changes often; of course, one should always commit changes in logical pieces. Since your changes are committed locally, not to the origin/master ...