mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2026-01-07 01:49:32 -06:00
chore: force-generate all markdown files and README.md
This commit is contained in:
31
contents/apply-diff-file.md
Normal file
31
contents/apply-diff-file.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Apply Diff File
|
||||
|
||||
|
||||

|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git apply changes.diff
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Apply a diff file of uncommitted changes.**
|
||||
|
||||
|
||||
```sh
|
||||
git apply changes.diff
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git apply changes.diff' to apply the changes from a diff file`.
|
||||
|
||||
|
||||
#### Tags
|
||||
`diff`, `apply`, `uncommitted`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
31
contents/apply-patch-with-commit-metadata.md
Normal file
31
contents/apply-patch-with-commit-metadata.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Apply Patch with Commit Metadata
|
||||
|
||||
|
||||

|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git am my-changes.patch
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Apply a patch file and preserve commit info.**
|
||||
|
||||
|
||||
```sh
|
||||
git am my-changes.patch
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git am my-changes.patch' to apply the patch and preserve commit messages, authorship, and timestamps`.
|
||||
|
||||
|
||||
#### Tags
|
||||
`patch`, `am`, `apply`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
47
contents/create-patch-from-last-commit-s.md
Normal file
47
contents/create-patch-from-last-commit-s.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Create Patch from Last Commit(s)
|
||||
|
||||
|
||||

|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git format-patch HEAD~1
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Create a .patch file for the last commit.**
|
||||
|
||||
|
||||
```sh
|
||||
git format-patch HEAD~1
|
||||
```
|
||||
- **Create a single patch file for all commits on top of main.**
|
||||
|
||||
|
||||
```sh
|
||||
git format-patch origin/main..HEAD --stdout > my-changes.patch
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git format-patch HEAD~1' to create a patch for the last commit`.
|
||||
2. Use '`git format-patch origin/main..HEAD --stdout > my-changes.patch' to create a single patch file for multiple commits`.
|
||||
|
||||
|
||||
#### Warnings
|
||||
- ⚠️ Patch files created this way include commit messages, authorship, and timestamps.
|
||||
- ⚠️ Use 'git am' to apply these patches on another system.
|
||||
|
||||
|
||||
#### Links
|
||||
- [Official Docs](https://git-scm.com/docs/git-format-patch)
|
||||
|
||||
|
||||
#### Tags
|
||||
`patch`, `format-patch`, `committed`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
39
contents/create-patch-from-uncommitted-changes.md
Normal file
39
contents/create-patch-from-uncommitted-changes.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Create Patch from Uncommitted Changes
|
||||
|
||||
|
||||

|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git diff > changes.diff
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Create a diff file of uncommitted changes.**
|
||||
|
||||
|
||||
```sh
|
||||
git diff > changes.diff
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git diff > changes.diff' to save uncommitted changes to a file`.
|
||||
|
||||
|
||||
#### Warnings
|
||||
- ⚠️ This does NOT preserve commit metadata or history—just raw changes.
|
||||
|
||||
|
||||
#### Links
|
||||
- [Official Docs](https://git-scm.com/docs/git-diff)
|
||||
|
||||
|
||||
#### Tags
|
||||
`diff`, `uncommitted`, `snapshot`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
13
contents/patch-vs-diff-quick-reference.md
Normal file
13
contents/patch-vs-diff-quick-reference.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Patch vs Diff: Quick Reference
|
||||
|
||||
|
||||

|
||||
|
||||
#### Tags
|
||||
`patch`, `diff`, `reference`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
172
contents/sharing-changes-as-patch-files.md
Normal file
172
contents/sharing-changes-as-patch-files.md
Normal file
@@ -0,0 +1,172 @@
|
||||
# Sharing Changes as Patch Files
|
||||
|
||||
|
||||

|
||||
> Generate and share patch files for committed or uncommitted changes.
|
||||
|
||||
How to create patch files from your changes for sharing via email, SCP, Slack, or other means. Covers both committed (with full commit metadata) and uncommitted changes.
|
||||
|
||||
|
||||
#### Tags
|
||||
`patch`, `diff`, `sharing`, `email`, `collaboration`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
|
||||
---
|
||||
|
||||
### Subcommands
|
||||
#### Create Patch from Last Commit(s)
|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git format-patch HEAD~1
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Create a .patch file for the last commit.**
|
||||
|
||||
|
||||
```sh
|
||||
git format-patch HEAD~1
|
||||
```
|
||||
- **Create a single patch file for all commits on top of main.**
|
||||
|
||||
|
||||
```sh
|
||||
git format-patch origin/main..HEAD --stdout > my-changes.patch
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git format-patch HEAD~1' to create a patch for the last commit`.
|
||||
2. Use '`git format-patch origin/main..HEAD --stdout > my-changes.patch' to create a single patch file for multiple commits`.
|
||||
|
||||
|
||||
#### Warnings
|
||||
- ⚠️ Patch files created this way include commit messages, authorship, and timestamps.
|
||||
- ⚠️ Use 'git am' to apply these patches on another system.
|
||||
|
||||
|
||||
#### Links
|
||||
- [Official Docs](https://git-scm.com/docs/git-format-patch)
|
||||
|
||||
|
||||
#### Tags
|
||||
`patch`, `format-patch`, `committed`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
|
||||
#### Apply Patch with Commit Metadata
|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git am my-changes.patch
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Apply a patch file and preserve commit info.**
|
||||
|
||||
|
||||
```sh
|
||||
git am my-changes.patch
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git am my-changes.patch' to apply the patch and preserve commit messages, authorship, and timestamps`.
|
||||
|
||||
|
||||
#### Tags
|
||||
`patch`, `am`, `apply`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
|
||||
#### Create Patch from Uncommitted Changes
|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git diff > changes.diff
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Create a diff file of uncommitted changes.**
|
||||
|
||||
|
||||
```sh
|
||||
git diff > changes.diff
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git diff > changes.diff' to save uncommitted changes to a file`.
|
||||
|
||||
|
||||
#### Warnings
|
||||
- ⚠️ This does NOT preserve commit metadata or history—just raw changes.
|
||||
|
||||
|
||||
#### Links
|
||||
- [Official Docs](https://git-scm.com/docs/git-diff)
|
||||
|
||||
|
||||
#### Tags
|
||||
`diff`, `uncommitted`, `snapshot`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
|
||||
#### Apply Diff File
|
||||
|
||||
#### Command
|
||||
```sh
|
||||
git apply changes.diff
|
||||
```
|
||||
|
||||
#### Examples
|
||||
- **Apply a diff file of uncommitted changes.**
|
||||
|
||||
|
||||
```sh
|
||||
git apply changes.diff
|
||||
```
|
||||
|
||||
|
||||
#### Steps
|
||||
1. Run '`git apply changes.diff' to apply the changes from a diff file`.
|
||||
|
||||
|
||||
#### Tags
|
||||
`diff`, `apply`, `uncommitted`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
|
||||
#### Patch vs Diff: Quick Reference
|
||||
|
||||
#### Tags
|
||||
`patch`, `diff`, `reference`
|
||||
|
||||
#### Author
|
||||
mike-rambil
|
||||
|
||||
#### Last Updated
|
||||
2024-06-10
|
||||
|
||||
Reference in New Issue
Block a user