main):
git fetch origin
git switch -c feature/update-config origin/main
On older Git environments:
git checkout -b feature/update-config origin/main
Add or edit files.
git add path/to/modified-file.txt
git add path/to/another-file.txt
git commit -m "Update config handling and add example cloud-init"
(Optional) When you need to incorporate updates from the parent branch:
Rebase approach:
git fetch origin
git rebase origin/main
If conflicts occur, resolve them and then:
git add <conflicted-files>
git rebase --continue
Merge approach:
git fetch origin
git merge origin/main
Resolve conflicts and commit the merge.
main):
git push -u origin feature/update-config
For the first push, use -u to set the upstream branch; this makes future pushes and pulls easier.
If you want to refine the changes locally or continue working before requesting a public review, use Create draft pull request to keep the PR in a “draft” state.
git add .
git commit -m "Address review: fix edge case"
git push
Update your local main branch to the latest:
git checkout main
git pull origin main
Delete the now-unnecessary branch locally:
git branch -d feature/update-config
If the remote-tracking branch still appears in git branch -r or git branch -a,
delete the corresponding remote-tracking branch explicitly:
git branch -dr origin/feature/update-config
Or, to clean up all “ghost” remote-tracking branches at once:
git fetch --prune origin
If needed, delete the remote branch as well:
git push origin --delete feature/update-config