Permalink
Browse files

add git-set-rebase

  • Loading branch information...
1 parent 076297e commit 525c92eaabce906fc177a9d3023ee332f11af897 @langmartin committed Sep 14, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 git-commands.el
View
@@ -124,4 +124,18 @@
nil
git-commands-map)
+(defun git-get-current-branch ()
+ (with-temp-buffer
+ (shell-command "git symbolic-ref HEAD" (current-buffer))
+ (let ((str (chomp (buffer-string))))
+ (string-match "^refs/.*?/\\(.*\\)$" str)
+ (match-string 1 str))))
+
+(defun git-set-rebase ()
+ (interactive)
+ (shell-command
+ (concat "git config \"branch."
+ (git-get-current-branch)
+ ".rebase\" true")))
+
(provide 'git-commands)

0 comments on commit 525c92e

Please sign in to comment.