diff options
author | Franck Cuny <franck@fcuny.net> | 2021-08-08 11:45:07 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2021-08-08 11:45:07 -0700 |
commit | 99356db6b984356f4d337bd2067e6f70437fa94d (patch) | |
tree | 14f2581b52eb662783d2248a10d84cfe7eb0819d | |
parent | emacs: rename eshell buffer (diff) | |
download | emacs.d-99356db6b984356f4d337bd2067e6f70437fa94d.tar.gz |
emacs: add function to clone a git repository
Diffstat (limited to '')
-rw-r--r-- | emacs/custom/fcuny-git.el | 8 |
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) |