mirror of
https://github.com/actions/checkout.git
synced 2025-03-28 19:10:06 +01:00
README.md: Document how to do git diff vs. master
#161 and many other posts say that doing `git diff` was easy in v1 but is tricky in v2. Can we please add two items to README.md that describes how to properly do `git diff` in v2?
This commit is contained in:
parent
096e927750
commit
bc7e2aae6a
1 changed files with 18 additions and 0 deletions
18
README.md
18
README.md
|
@ -210,6 +210,24 @@ jobs:
|
|||
git fetch --prune --unshallow
|
||||
```
|
||||
|
||||
## Lines of code added or modified vs. master
|
||||
```yaml
|
||||
# FAILS!!!
|
||||
- run: git diff --diff-filter=am master HEAD > git_diff.txt || true
|
||||
# fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
|
||||
- run: git diff --diff-filter=am origin/master HEAD > git_diff.txt || true
|
||||
# fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
|
||||
```
|
||||
|
||||
## File paths of files added or modified vs. master
|
||||
```yaml
|
||||
# FAILS!!!
|
||||
- run: git diff --diff-filter=am --name-only master HEAD > git_diff.txt || true
|
||||
# fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
|
||||
- run: git diff --diff-filter=am --name-only origin/master HEAD > git_diff.txt || true
|
||||
# fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||
|
|
Loading…
Add table
Reference in a new issue