summary refs log tree commit diff
path: root/emacs/custom/fcuny-git.el
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2021-08-08 11:45:07 -0700
committerFranck Cuny <franck@fcuny.net>2021-08-08 11:45:07 -0700
commit99356db6b984356f4d337bd2067e6f70437fa94d (patch)
tree14f2581b52eb662783d2248a10d84cfe7eb0819d /emacs/custom/fcuny-git.el
parentemacs: rename eshell buffer (diff)
downloademacs.d-99356db6b984356f4d337bd2067e6f70437fa94d.tar.gz
emacs: add function to clone a git repository
Diffstat (limited to '')
-rw-r--r--emacs/custom/fcuny-git.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/emacs/custom/fcuny-git.el b/emacs/custom/fcuny-git.el
index ac9b837..7cc0feb 100644
--- a/emacs/custom/fcuny-git.el
+++ b/emacs/custom/fcuny-git.el
@@ -1,4 +1,5 @@
 (require 'fcuny-defuns)
+(require 'fcuny-vars)
 
 (use-package gitconfig-mode
   :ensure t)
@@ -120,4 +121,11 @@
 ;; with performances.
 (setq vc-handled-backends (delq 'Git vc-handled-backends))
 
+(defun fcuny/clone-repo (url)
+  "Clone a repository in the workspace"
+  (interactive "sURL:")
+  (let* ((repo-name (magit-clone--url-to-name url))
+         (target-dir (concat fcuny/path-workspace "/" repo-name)))
+    (magit-clone-regular url target-dir nil)))
+
 (provide 'fcuny-git)