Add unamend alias to help reversing an amend
* `unamend` applies the diff from a previous `commit --amend` to the working tree to make it easy to undo an accidental amend. * Removed `last` alias, use `checkout -` instead * Rename `name` alias to `refname` to be less ambiguous
This commit is contained in:
		
							parent
							
								
									e63768ba22
								
							
						
					
					
						commit
						854df7bc22
					
				
							
								
								
									
										12
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								config
									
									
									
									
									
								
							| @ -5,6 +5,11 @@ | ||||
| 	unstage = reset -q HEAD -- | ||||
| 
 | ||||
| 	amend = commit --amend | ||||
| 	unamend = !git diff $(git reflog -2 | \ | ||||
| 		awk \"{print \\$1}\" | \ | ||||
| 		sed -e ':a' -e 'N' -e '$!ba' -e 's/\\n/../g') | \ | ||||
| 		git apply - 2> /dev/null || \ | ||||
| 			echo \"error: last commit was not amended\" | ||||
| 	fixup = commit --fixup | ||||
| 	squash = commit --squash | ||||
| 	prepare = rebase -i --fork-point | ||||
| @ -12,11 +17,10 @@ | ||||
| 	list = branch | ||||
| 	create = checkout -b | ||||
| 	delete = branch -D | ||||
| 	name = rev-parse --abbrev-ref HEAD | ||||
| 	last = !sh -c 'git reflog | grep \" checkout: moving from\" | head -n 1 | awk \"{ print \\$6 }\"' | ||||
| 	refname = rev-parse --abbrev-ref HEAD | ||||
| 
 | ||||
| 	publish = !git push -u origin `git name` | ||||
| 	unpublish = !git push -u origin :`git name` | ||||
| 	publish = !git push -u origin `git refname` | ||||
| 	unpublish = !git push -u origin :`git refname` | ||||
| 	force = push --force-with-lease | ||||
| 
 | ||||
| 	changes = !sh -c 'git log --oneline $1..' -- | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user