Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Optionally stage also untracked files in magit-stage-all.

  • Loading branch information...
commit 9dfd604cd8333dc05132d74faed5c569abe19d06 1 parent aec91c2
@mvollmer mvollmer authored
Showing with 16 additions and 6 deletions.
  1. +5 −3 NEWS
  2. +5 −3 magit.el
  3. +6 −0 magit.texi
@@ -13,6 +13,11 @@ Changes in magit 0.8:
* Hitting C-c C-s while editing a commit message will toggle the
"--signoff" option.
+* Hitting 's' on the "Untracked files" section title will stage all
+ untracked files.
+* Hitting 'C-u S' will stage all untracked and tracked files.
* Performance improvements in the status buffer.
* Bug fixes to make Magit work better with newer Gits.
@@ -51,9 +56,6 @@ Changes in magit 0.7:
* Typing 'k' on the "Untracked files" section title will offer to
delete all untracked files.
-* Similarily, hitting 's' on the "Untracked files" section title will
- stage all untracked files.
* Magit understands a bit of git-svn: the status buffer shows unpushed
and unpulled commits, 'N r' runs git svn rebase, and 'N c' runs git
svn dcommit.
8 magit.el
@@ -1983,9 +1983,11 @@ in log buffer."
(error "Can't unstage this diff"))))
-(defun magit-stage-all ()
- (interactive)
- (magit-run-git "add" "-u" "."))
+(defun magit-stage-all (&optional also-untracked-p)
+ (interactive "P")
+ (if also-untracked-p
+ (magit-run-git "add" ".")
+ (magit-run-git "add" "-u" ".")))
(defun magit-unstage-all ()
6 magit.texi
@@ -204,6 +204,9 @@ You can add a untracked file to the staging area with @kbd{s}. If
point is on the @emph{Untracked files} section title when you it
@kbd{s}, all untracked files are staged.
+Typing @kbd{C-u S} anywhere will also stage all untracked files,
+together with all changes to the tracked files.
You can instruct Git to ignore them by typing @kbd{i}. This will add
the filename to the @code{.gitignore} file. Typing @kbd{C-u i} will
ask you for the name of the file to ignore. This is useful to ignore
@@ -246,6 +249,9 @@ the changes, otherwise it is not.)
To move all hunks of all diffs into the staging area in one go, type
@kbd{S}. To unstage everything, type @kbd{U}.
+Typing @kbd{C-u S} will stage all untracked files in addition to the
+changes to tracked files.
You can discard uncommitted changes by moving point into a hunk and
typing @kbd{k}. The changes to discard are selected as with @kbd{s}
and @kbd{u}.

0 comments on commit 9dfd604

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