mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 18:18:37 +08: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
					
				
							
								
								
									
										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…
	
		Reference in New Issue
	
	Block a user
	 Christian Clauss
						Christian Clauss