Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing documentation about how to combine a series of GitHub commits into one commit #450

Open
1 task
shmonks opened this issue Nov 21, 2024 · 0 comments
Labels
complexity: small All steps are laid out in detail so that someone new to the project can work on it feature: docs: PD team documentation documentation on PD team processes and architecture, etc. ready for dev lead role: back end role: dev size: 0.25pt Can be done in 0.5-1.5 hours

Comments

@shmonks
Copy link
Member

shmonks commented Nov 21, 2024

Overview

We are striving to write documentation that helps developers on our team and our stakeholders' teams work smoothly and successfully.

We need to add information about how to combine a series of GitHub commits, so that the PR process is simplified and migration conflicts are more easily dealt with.

Documentation Notes

What's missing?

This is a quick way of combining a series of GitHub commits into one:

  1. Assume we're at the head of the PR branch with 4 commits and want to combine the 4 commits into one.
  2. Soft reset to the earliest commit, with all the changes of the later commits staged.
    git reset --soft Head~3
  3. Amend the staged changed into the earliest commit.
    git commit --amend --no-edit
    note: omit the --no-edit flag if you want to edit the commit message.

Although there are other ways of combining GitHub commits (like lazygit and the standard interactive rebase), these are more interactive than the process described above and therefore more difficult to describe in text form.

Where would this information have been useful?

  • https://github.com/hackforla/peopledepot/pull/398/commits contained 4 commits, which were then merged into one before rebasing it to main, in order to make it easier to work with.
  • This info could be useful when dealing with PRs that need to be rebased to upstream/main, especially when there are also migration conflicts in which more than one commit in the PR contains migration files. If the PR commits are all merged into one, the migration conflicts can be simplified along with the repetitive need to resolve merges.

Which roles will benefit most from this information?

  • Backend
  • Dev

Action Items

  • Add the information in the Documentation Notes section above to the relevant /docs/contributing/ sub-folder listed in Resource 1.01 below.

Resources/Instructions/Tags

  • 1.01 The contributing docs should go inside the /docs/contributing/ folder or sub-folders
    • howto guides --> /docs/contributing/howto/
    • tutorials --> /docs/contributing/tutorial/
  • 1.02 Tag: git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: small All steps are laid out in detail so that someone new to the project can work on it feature: docs: PD team documentation documentation on PD team processes and architecture, etc. ready for dev lead role: back end role: dev size: 0.25pt Can be done in 0.5-1.5 hours
Projects
Status: 🆕New Issue Review
Development

No branches or pull requests

1 participant