- Start with the remote main (or master) branch.
- If the repo is not on your local drive, clone the repo to your local drive. Otherwise, do a
git pull
to the local drive. - Create a local development branch.
- Repeat until you are done with your change:
- Repeat until you are done for your current session:
- Make your changes to the source code.
- Loop.
- Publish your development branch. (It’s good to have an offsite backup).
- Loop.
- Repeat until you are done for your current session:
- Make sure your local main branch is in sync with the remote main branch.
- If not,
git pull main
, then merge to the development branch and publish again.
- If not,
- Create a pull request on remote.
- Merge the pull request on remote.
- When you are finished with a branch:
- Delete the development branch on remote.
- On local (using either the Git command line or VS Code):
git checkout main
- To point to the local main branch.
git pull
- To get local main branch in sync with remote main branch.
git branch -d <branch-name>
- To delete the development branch.
git fetch –-prune
- To delete the remote tracking reference.