Created
June 20, 2016 00:20
-
-
Save colonelpanic8/f5659a88c2c8312d30ee4733579a9774 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun github-clone-get-repo-name-from-remote (&optional remote) | |
| (unless remote | |
| (setq remote | |
| (magit-read-remote "Select a remote: "))) | |
| (github-clone-repo-name | |
| (magit-get "remote" remote "url"))) | |
| (defun github-clone-fork-remote (&optional remote) | |
| (interactive (list (magit-read-remote "Select a remote"))) | |
| (cl-destructuring-bind (user . repo) | |
| (github-clone-get-repo-name-from-remote remote) | |
| (github-clone-fork-repo (github-clone-info user repo)))) | |
| (defun github-clone-add-existing-remote (&optional remote-in-network) | |
| (interactive | |
| (list (magit-read-remote "Select the remote whose network you would like to search"))) | |
| (cl-destructuring-bind (user . repo) | |
| (github-clone-get-repo-name-from-remote remote-in-network) | |
| (let ((candidates (github-clone-remotes user repo))) | |
| (cl-destructuring-bind (selected-user . selected-repo) | |
| (assoc (completing-read "Select a remote to add: " candidates) candidates) | |
| (magit-remote-add selected-user selected-repo))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment