michaelsembwever commented on code in PR #311: URL: https://github.com/apache/cassandra-website/pull/311#discussion_r2910002098
########## site-content/source/modules/ROOT/pages/development/how_to_commit.adoc: ########## @@ -8,6 +8,38 @@ The fix lands on the oldest release branch and is then forward-merges it into ea This keeps a clean, traceable history and a single logical unit of work per ticket per branch, while preventing unintended diffs from being pulled forward automatically. +== Introduction for New Committers + +To be an effective committer, you should be familiar with the following background details. While this is not a git tutorial, it outlines the expected workflow: + +* **Using CLI vs GitHub web UI:** We recommend using the Git CLI rather than the GitHub web UI. +* **Local feature branches:** Always do your work in a local feature/topic branch. Do not push your personal feature branches upstream; only the canonical trunk and release branches should be pushed to the shared repository when merging changes. +* **Workflow:** This repository uses a squash-rebase-merge workflow with feature branches. Fixes land on the oldest supported branch and are merged forward into newer branches (using ours merges and amended merge commits). +* **Basic git commands you should know:** +** `git remote add` & `git remote set-url` +** Squashing commits with `git rebase -i` +** Updating a commit with `git commit --amend` +** `git push origin <branches> --atomic -n` + +Use the following Git CLI commands when merging a PR: + +Step 1: From your project repository, check out a new branch and test the changes. +[source,shell] +---- +git checkout -b <github_username>-feature/<pr_branch> trunk +git fetch https://github.com/<github_username>/<repo_name>.git <pr_branch>:<github_username>-feature/<pr_branch> +git checkout <github_username>-feature/<pr_branch> +---- + +Step 2: Squash, fast-forward merge, and update on GitHub following the project workflow. +[source,shell] +---- +git rebase -i trunk # squash to a single, well-titled commit +git checkout trunk +git merge --ff-only <github_username>-feature/<pr_branch> +git push origin trunk --atomic Review Comment: ```suggestion git switch trunk # there should only be one commit, squashed git cherry-pick <jira>/<branch> git push --atomic origin trunk -n # check dry-run looks correct git push --atomic origin trunk ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

