Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add git-set-rebase

  • Loading branch information...
commit 525c92eaabce906fc177a9d3023ee332f11af897 1 parent 076297e
Lang Martin authored September 14, 2012

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  git-commands.el
14  git-commands.el
@@ -124,4 +124,18 @@
124 124
   nil
125 125
   git-commands-map)
126 126
 
  127
+(defun git-get-current-branch ()
  128
+  (with-temp-buffer
  129
+    (shell-command "git symbolic-ref HEAD" (current-buffer))
  130
+    (let ((str (chomp (buffer-string))))
  131
+      (string-match "^refs/.*?/\\(.*\\)$" str)
  132
+      (match-string 1 str))))
  133
+
  134
+(defun git-set-rebase ()
  135
+  (interactive)
  136
+  (shell-command
  137
+   (concat "git config \"branch."
  138
+           (git-get-current-branch)
  139
+           ".rebase\" true")))
  140
+
127 141
 (provide 'git-commands)

0 notes on commit 525c92e

Please sign in to comment.
Something went wrong with that request. Please try again.