Open shmonks opened 1 month ago
main
. For example, you've made changes to CONTRIBUTING.md
in a GitHub branch, after you copied content from that file to another file (e.g.,docs/contributing/dev_environment.md
). You want to apply the changes you made to CONTRIBUTING.md
to docs/contributing/dev_environment.md
as well.Rebase/Merge your feature branch to main
.
Undo changes to the file you changed (replacing CONTRIBUTING.md
with the relevant filename):
git reset upstream/main -- CONTRIBUTING.md
Now switch to the unmerged branch with the changes (replacing our-branch-original
with the relevant branch name):
git switch our-branch-original
Create a patch of the changes (replacing with relevant filename):
git format-patch hackforla/main CONTRIBUTING.md
# only changes to CONTRIBUTING.md
# include changes since we branched off from hackforla/main
# may need to create a temporary branch where hackforla/main used to be for this command
5. Switch to the rebased branch without the changes to the file (in this example `CONTRIBUTING.md`):
```bash
git switch our-branch-rebased
docs/contributing/dev_environment.md
:
patch -p1 docs/contributing/dev_environment.md 0001-add-to-dev-environment.patch
@shmonks, I'll try to rephrase that here to see if it becomes more understandable. It made sense until you read it weeks later...
This is the scenario:
You made a change to CONTRIBUTING.md
, unmerged.
Another dev split CONTRIBUTING.md
into several files and it's merged into main
.
CONTRIBUTING.md
is now in a file called contributing/dev_environment.md
You can re-type (copy/paste) the change manually into contributing/dev_environment.md
, or you can use a patch to apply the change semi-automatically.
This guide is useful for the more complex changes.
We need to add a description of how to apply changes from one GitHub file to another, so that developers can synchronize changes and keep files up-to-date.
1.01 git, diff, patch, moved content
Here's how to apply changes from one GitHub file to another:
Rebase/Merge your feature branch to main
.
Undo changes to the file you changed (replacing CONTRIBUTING.md
with the relevant filename):
git reset upstream/main -- CONTRIBUTING.md
Now switch to the unmerged branch with the changes (replacing our-branch-original
with the relevant branch name):
git switch our-branch-original
Create a patch of the changes (replacing with relevant filename):
git format-patch hackforla/main CONTRIBUTING.md
# only changes to CONTRIBUTING.md
# include changes since we branched off from hackforla/main
# may need to create a temporary branch where hackforla/main used to be for this command
5. Switch to the rebased branch without the changes to the file (in this example `CONTRIBUTING.md`):
```bash
git switch our-branch-rebased
docs/contributing/dev_environment.md
:
patch -p1 docs/contributing/dev_environment.md 0001-add-to-dev-environment.patch
[REPLACE WITH URL OR INDICATE NEW PAGE AND PARENT PAGE]
CONTRIBUTING.md
, unmerged.CONTRIBUTING.md
into several files and it's merged into main
.
CONTRIBUTING.md
is now in a file called contributing/dev_environment.md
contributing/dev_environment.md
Dependency
Overview
We need to make it easy to:
This issue is the place to record missing documentation and start creating related new issues.
Details
see the following issues instead
- #419 - #421 - #422 - #423 - #424Action Items
Action Items
Resources/Instructions/Tags
Documentation Addition Notes
What's missing?
[REPLACE WITH DESCRIPTION OF WHAT'S MISSING FROM THE DOCUMENTATION]
Where should it go?
[REPLACE WITH URL OR INDICATE NEW PAGE AND PARENT PAGE]
When would this information have been useful?
[REPLACE WITH LINK TO THE PR/ISSUE/SITUATION THAT PROMPTED THE NEED FOR THIS CHANGE/ADDITION]
Which roles will benefit most from this information?
[REPLACE WITH ROLES]