Created
February 11, 2014 10:54
Small function for nice integration with git add and commit in Emacs workflow
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 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