From 1d9789d1e9459b91f58dc2db960c2fa5ba5460da Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 5 May 2019 23:10:42 -0400 Subject: magit: Add command to copy branch --- lisp/km-magit.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp/km-magit.el') diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 8faceeb..e672ec8 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -158,6 +158,16 @@ namespace." (unless (string= old new) (magit-run-git "branch" (if force "-M" "-m") old new))) +(defun km/magit-branch-copy (old new &optional force) + (interactive + (let ((branch (magit-read-local-branch "Copy branch"))) + (list branch + (magit-read-string-ns (format "Copy branch '%s' to" branch) + branch) + current-prefix-arg))) + (unless (string= old new) + (magit-run-git "branch" (if force "-C" "-c") old new))) + (defun km/magit-checkout-master () "Check out master branch. \n(git checkout master)" -- cgit v1.2.3