GitHub workflow for single clone
The following image illustrates the workflow for using Git and GitHub to add or change content using a working branch for a single repository. The step shown in red is a one-time action for each machine you work on. The numbered steps (in black) are described in the table below.
|Description of steps
|Git command / GitHub actions
|Clone the repo (once per machine)
git clone https://github.com/<your-account>/PSModuleProject
|Checkout the main branch
git checkout main
|Sync the main branch
git pull origin main
|Create a new working branch
git checkout -b v1release
|Create new content
|Use VS Code to create or edit files
|Add changes for Git tracking
git add -A
|Commit changes to local repo
git commit -m 'commit message'
|Push working branch to origin
git push origin v1release
|Submit pull request
https://github.com/<your-account>/PSModuleProject/pulls and click the New pull request button.
Base repository: your-account/PSModuleProject
base: main <–
head repository: your-account/PSModuleProject
Fill out the pull request description and click Submit.
|PR is reviewed
|Make the necessary changes based on the review feedback.
|PR is merged
|Go to step 10
|Cleanup unneeded branch info
git checkout main; git push origin --delete v1release; git branch -D v1release
git push command deletes the branch in your fork and deletes the tracking branch from your local repo. The
git branch command delete the branch from your local repo.
|Start new post
|Go to step 0