Created
February 11, 2014 10:54
-
-
Save ejbs/8932798 to your computer and use it in GitHub Desktop.
Small function for nice integration with git add and commit in Emacs workflow
This file contains 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 git-add-and-commit-current-file () | |
(interactive) | |
(let ((bufn (buffer-file-name (current-buffer)))) | |
(if bufn | |
(progn | |
(shell-command (format "git add %s" bufn)) | |
(shell-command (format "git commit -m \"%s\"" (read-from-minibuffer "Message: ")))) | |
(print "Current buffer has no file associated with it")))) | |
;; (global-set-key (kbd "C-c C-f") 'git-add-and-commit-current-file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment