Browse Source

git: redo aliases

Thomas Dy 10 months ago
parent
commit
1f13445b66
1 changed files with 12 additions and 3 deletions
  1. 12 3
      .config/git/config

+ 12 - 3
.config/git/config

@@ -33,13 +33,22 @@
 	lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
 	p = push
 	pf = push --force-with-lease
-	ff = merge --ff-only @{upstream}
+	# history fast-forward (to push)
+	hf = merge --ff-only @{push}
+	# history reset hard (to push)
+	hrh = reset --hard @{push}
+	# head's history fast-forward (works even if a different branch is checked out)
+	hhf = "!git push . $(git head)@{upstream}:$(git head)"
+	# head's history reset hard
+	hhrh = hfh --force
+	# rebase upstream
 	ru = rebase @{upstream}
+	# rebase interactive upstream
 	riu = rebase -i @{upstream}
+	# rebase interactive autosquash upstream
 	riau = rebase -i --autosquash @{upstream}
 	ca = commit --amend
-	smash = "!git add -u && git ca --no-edit && git pof"
+	smash = "!git add -u && git ca --no-edit && git pf"
 	reset-head = remote set-head origin -a
-	ff-head = "!git push . origin/HEAD:$(git head)"
 	head = for-each-ref --format="%(symref:lstrip=-1)" refs/remotes/origin/HEAD
 	sh = "!git switch $(git head)"