Skip to content

Commit 0d22ae8

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/devBranch' into devBranch
2 parents f2eba5c + 17193b6 commit 0d22ae8

25 files changed

+120
-124
lines changed

contents/apply-diff-file.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,22 @@
44

55
# Apply Diff File
66

7+
78
![Category: Patch & Diff](https://img.shields.io/badge/Category-Patch%20%26%20Diff-blue)
89

910
#### Command
10-
1111
```sh
1212
git apply changes.diff
1313
```
1414

1515
#### Examples
16+
- **Apply a diff file of uncommitted changes.**
1617

17-
- **Apply a diff file of uncommitted changes.**
18-
19-
```sh
20-
git apply changes.diff
21-
```
22-
23-
- **Show what would change if the diff were applied.**
18+
```sh
19+
git apply changes.diff```
20+
- **Show what would change if the diff were applied.**
2421
25-
````sh
22+
```sh
2623
git apply --stat changes.diff```
2724
2825
@@ -35,4 +32,3 @@ git apply --stat changes.diff```
3532
---
3633
3734
_Author: mike-rambil • Updated: 2024-06-10 • Tags: diff, apply, uncommitted_
38-
````

contents/apply-patch-with-commit-metadata.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ git am my-changes.patch
1313
```
1414

1515
#### Examples
16-
- **Apply a patch file and preserve commit info.**
16+
- **Apply a patch file and preserve commit info.**
1717

18-
```sh
18+
```sh
1919
git am my-changes.patch```
20-
- **Apply a patch and add a Signed-off-by line.**
20+
- **Apply a patch and add a Signed-off-by line.**
2121
22-
```sh
22+
```sh
2323
git am --signoff my-changes.patch```
2424
2525

contents/check-existing-worktrees.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ git worktree list
1111
```
1212

1313
#### Examples
14-
- **List all active worktrees.**
14+
- **List all active worktrees.**
1515

16-
```sh
16+
```sh
1717
git worktree list```
18-
- **List worktrees in a machine-readable format.**
18+
- **List worktrees in a machine-readable format.**
1919
20-
```sh
20+
```sh
2121
git worktree list --porcelain```
2222
2323

contents/create-a-new-worktree.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ git worktree add <path> <branch>
1313
```
1414

1515
#### Examples
16-
- **Create a new worktree for the feature branch.**
16+
- **Create a new worktree for the feature branch.**
1717

18-
```sh
18+
```sh
1919
git worktree add ../feature-branch feature```
20-
- **Create a worktree for a hotfix branch.**
20+
- **Create a worktree for a hotfix branch.**
2121
22-
```sh
22+
```sh
2323
git worktree add ../hotfix hotfix-branch```
2424
2525

contents/create-patch-from-last-commit-s.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ git format-patch HEAD~1
1111
```
1212

1313
#### Examples
14-
- **Create a .patch file for the last commit.**
14+
- **Create a .patch file for the last commit.**
1515

16-
```sh
16+
```sh
1717
git format-patch HEAD~1```
18-
- **Create a single patch file for all commits on top of main.**
18+
- **Create a single patch file for all commits on top of main.**
1919
20-
```sh
20+
```sh
2121
git format-patch origin/main..HEAD --stdout > my-changes.patch```
22-
- **Create patch files for the last two commits.**
22+
- **Create patch files for the last two commits.**
2323
24-
```sh
24+
```sh
2525
git format-patch -2```
26-
- **Create patch files for all commits since main.**
26+
- **Create patch files for all commits since main.**
2727
28-
```sh
28+
```sh
2929
git format-patch -2 origin/main..HEAD```
3030
3131

contents/create-patch-from-uncommitted-changes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ git diff > changes.diff
1313
```
1414

1515
#### Examples
16-
- **Create a diff file of uncommitted changes.**
16+
- **Create a diff file of uncommitted changes.**
1717

18-
```sh
18+
```sh
1919
git diff > changes.diff```
20-
- **Create a diff file for the last commit.**
20+
- **Create a diff file for the last commit.**
2121
22-
```sh
22+
```sh
2323
git diff HEAD~1 > last-commit.diff```
2424
2525

contents/delete-local-branches-whose-remote-is-gone-bash.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ git fetch -p && git branch -vv | grep '\[origin/.*: gone\]' | awk '{print $1}' |
1515
```
1616

1717
#### Examples
18-
- **Delete all local branches whose remote is gone.**
18+
- **Delete all local branches whose remote is gone.**
1919

20-
```sh
20+
```sh
2121
git fetch -p && git branch -vv | grep '\[origin/.*: gone\]' | awk '{print $1}' | xargs -r git branch -d```
22-
- **Delete only feature branches whose remote is gone.**
22+
- **Delete only feature branches whose remote is gone.**
2323
24-
```sh
24+
```sh
2525
git fetch -p && git branch -vv | grep '\[origin/feature: gone\]' | awk '{print $1}' | xargs -r git branch -d```
2626
2727

contents/delete-local-branches-whose-remote-is-gone-powershell.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ git branch -vv | ForEach-Object { if ($_ -match '\[.*: gone\]') { $parts = $_.Tr
1818
```
1919
2020
#### Examples
21-
- **Delete all local branches whose remote is gone.**
21+
- **Delete all local branches whose remote is gone.**
2222
23-
```sh
23+
```sh
2424
git fetch -p
2525
git branch -vv | ForEach-Object { if ($_ -match '[.*: gone]') { $parts = $_.Trim() -split '\s+'; $branch = $parts[0]; if ($branch -ne '') { git branch -d $branch } } }```
26-
- **Delete only feature branches whose remote is gone.**
26+
- **Delete only feature branches whose remote is gone.**
2727
28-
```sh
28+
```sh
2929
git fetch -p
3030
git branch -vv | ForEach-Object { if ($_ -match '[origin/feature: gone]') { $parts = $_.Trim() -split 's+'; $branch = $parts[0]; if ($branch -ne '') { git branch -d $branch } } }```
3131

contents/git-clean-remove-untracked-files-and-directories.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ git clean
2424

2525

2626
#### Examples
27-
- **Preview what will be deleted (dry run).**
27+
- **Preview what will be deleted (dry run).**
2828

29-
```sh
29+
```sh
3030
git clean -n -d```
31-
- **Delete all untracked files.**
31+
- **Delete all untracked files.**
3232
33-
```sh
33+
```sh
3434
git clean -f```
35-
- **Delete all untracked files and directories.**
35+
- **Delete all untracked files and directories.**
3636
37-
```sh
37+
```sh
3838
git clean -f -d```
39-
- **Interactive mode for selective deletion.**
39+
- **Interactive mode for selective deletion.**
4040
41-
```sh
41+
```sh
4242
git clean -i```
43-
- **Delete untracked and ignored files.**
43+
- **Delete untracked and ignored files.**
4444
45-
```sh
45+
```sh
4646
git clean -f -x```
4747
4848

contents/git-clone-mirror-repository.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ git clone --mirror https://github.com/example/repo.git
1515
```
1616

1717
#### Examples
18-
- **Create a full backup or migration of a repository.**
18+
- **Create a full backup or migration of a repository.**
1919

20-
```sh
20+
```sh
2121
git clone --mirror https://github.com/example/repo.git```
22-
- **Mirror-clone a private repo using SSH.**
22+
- **Mirror-clone a private repo using SSH.**
2323
24-
```sh
24+
```sh
2525
git clone --mirror [email protected]:org/repo.git```
2626
2727

0 commit comments

Comments
 (0)