toolbar: add backwards-compatibility for Commit::StageAll
[git-cola.git] / docs / git-cola.rst
blob45da362b48a403f7acfc26aa96f8d260723094b0
1 ========
2 git-cola
3 ========
5 SYNOPSIS
6 ========
7 ``git cola [options] [sub-command]``
10 DESCRIPTION
11 ===========
12 Git Cola is a sleek and powerful Git GUI.
15 OPTIONS
16 =======
17 ``--amend``
18 -----------
19 Start `git cola` in amend mode.
21 ``--prompt``
22 ------------
23 Prompt for a Git repository.  Defaults to the current directory.
25 ``-r, --repo <path>``
26 ---------------------
27 Open the Git repository at `<path>`.  Defaults to the current directory.
29 ``-s, --status-filter <filter>``
30 --------------------------------
31 Apply the path filter to the status widget.
33 ``--version``
34 -------------
35 Print the `git cola` version and exit.
37 ``-h, --help``
38 --------------
39 Show usage and optional arguments.
41 ``--help-commands``
42 -------------------
43 Show available sub-commands.
46 SUB-COMMANDS
47 ============
50 Apply patches.
52 archive
53 -------
54 Export tarballs from Git.
56 branch
57 ------
58 Create branches.
60 browse
61 ------
62 Browse tracked files.
64 config
65 ------
66 Configure settings.
68 dag
69 ---
70 Start the `git dag` Git history browser.
72 diff
73 ----
74 Diff changed files.
76 fetch
77 -----
78 Fetch history from remote repositories.
80 grep
81 ----
82 Use `git grep` to search for content.
84 merge
85 -----
86 Merge branches.
88 pull
89 ----
90 Fetch and merge remote branches.
92 push
93 ----
94 Push branches to remotes.
96 rebase
97 ------
98 Start an interactive rebase.
100 remote
101 ------
102 Create and edit remotes.
104 search
105 ------
106 Search for commits.
108 stash
109 -----
110 Stash uncommitted modifications.
114 Create tags.
116 version
117 -------
118 Print the `git cola` version.
121 CONFIGURE YOUR EDITOR
122 =====================
123 The editor used by `Ctrl-e` is configured from the Preferences screen.
125 The following environment variables are consulted when no editor is configured.
126 If defined, the first of these variables is used:
128 * `GIT_VISUAL`
129 * `VISUAL`
130 * `GIT_EDITOR`
131 * `EDITOR`
133 The `*VISUAL` variables are consulted before the `*EDITOR` variables so that you can
134 configure a graphical editor independently of the editor used by the Git CLI.
136 *ProTip*: Configuring your editor to `gvim -f -p` will open multiple tabs
137 when editing files.  `gvim -f -o` uses splits.
139 `git cola` is {vim, emacs, textpad, notepad++}-aware.
140 When you select a line in the diff or grep screens and press any of
141 `Enter`, `Ctrl-e`, or the `Edit` button, you are taken to that exact line.
143 The editor preference is saved in the `gui.editor` variable using
144 `git config <http://git-scm.com/docs/git-config>`_.
146 The following are some recommend editor configurations.
148 * Neovim + Neovim-Qt
150 .. sourcecode:: sh
152    git config --global core.editor nvim
153    git config --global gui.editor 'nvim-qt --nofork'
155 * Vim + gvim
157 .. sourcecode:: sh
159    git config --global core.editor vim
160    git config --global gui.editor 'gvim -f'
162 * Sublime Text
164 .. sourcecode:: sh
166    git config --global gui.editor 'subl --wait'
169 KEYBOARD SHORTCUTS
170 ==================
171 `git cola` has many useful keyboard shortcuts.
173 Many of `git cola`'s editors understand vim-style hotkeys, eg. `{h,j,k,l}`
174 for navigating in the diff, status, grep, and file browser widgets.
176 `{d,u}` move down/up one half page at a time (similar to vim's `ctrl-{d,u}`).
177 The `space` and `shift-space` hotkeys are mapped to the same operations.
179 `Shift-{j,k,d,u,f,b,page-up,page-down,left,right,up,down}` can be be used in
180 the diff editor to select lines while navigating.
182 `s` is a useful hotkey in the diff editor.  It stages/unstages the current
183 selection when a selection is present.  When nothing is selected, the
184 diff hunk at the current text cursor position is staged.  This makes it very
185 easy to review changes by selecting good hunks with `s` while navigating down
186 and over hunks that are not going to be staged.
188 `Ctrl-u` in the diff editor reverts unstaged edits, and respects the
189 selection.  This is useful for selectively reverted edits from the worktree.
190 This same hotkey reverts the entire file when used from the status tool.
192 `Ctrl-s` in the diff editor and status tools stages/unstages the entire file.
194 You can see the available shortcuts by pressing pressing the ``?`` key,
195 choosing ``Help -> Keyboard shortcuts`` from the main menu,
196 or by consulting the `git cola keyboard shortcuts reference <https://git-cola.github.io/share/doc/git-cola/hotkeys.html>`_.
199 TOOLS
200 =====
201 The `git cola` interface is composed of various cooperating tools.
202 Double-clicking a tool opens it in its own subwindow.
203 Dragging it around moves and places it within the main window.
205 Tools can be hidden and rearranged however you like.
206 `git cola` carefully remembers your window layout and restores
207 it the next time it is launched.
209 The `Control-{1, 2, 3, ...}` hotkey gives focus to a specific tool.
210 A hidden tool can be re-opened using the `Tools` menu or
211 the `Shift+Control-{1, 2, 3, ...}` shortcut keys.
213 The Diff editor can be focused with `Ctrl-j`.
214 the Status tool can be focused with `Ctrl-k`.
215 the Commit tool can be focused with `Ctrl-l`.
218 .. _status:
220 STATUS
221 ======
222 The `Status` tool provides a visual analog to the
223 `git status <http://git-scm.com/docs/git-status>`_ command.
225 `Status` displays files that are `modified` relative to the staging area,
226 `staged` for the next commit, `unmerged` files from an in-progress merge,
227 and files that are `untracked` to git.
229 These are the same categories one sees when running
230 `git status <http://git-scm.com/docs/git-status>`_
231 on the command line.
233 You can navigate through the list of files using keyboard arrows as well
234 as the ergonomical and vim-like `j` and `k` shortcut keys.
236 There are several convenient ways to interact with files in the `Status` tool.
238 Selecting a file displays its diff in the `Diff` viewer.
239 Double-clicking a file stages its contents, as does the
240 the `Ctrl-s` shortcut key.
242 `Ctrl-e` opens selected files in the configured editor, and
243 `Ctrl-d` opens selected files using `git difftool <http://git-scm.com/docs/git-difftool>`_
245 Additional actions can be performed using the right-click context menu.
247 Drag and Drop
248 -------------
249 Files can be dragged from the the `Status` tool onto other applications.
251 Some terminals will treat a drag with multiple files by separating them with newlines,
252 which is less amenable for pasting command-line arguments.
254 To avoid this issue, hold down `Alt / Option` when dragging from the `Status` tool.
255 The drag and drop payload will no longer contain local file URLs -- it will contain
256 plain text that is amenable for use on a command-line.
258 Note: if drag and drop is not working and you are on Wayland then you may
259 need to ``export QT_QPA_PLATFORM=wayland`` in your environment.
261 Actions
262 -------
263 Clicking the `Staged` folder shows a diffstat for the index.
265 Clicking the `Modified` folder shows a diffstat for the worktree.
267 Clicking individual files sends diffs to the `Diff Display`.
269 Double-clicking individual files adds and removes their content from the index.
271 Various actions are available through the right-click context menu.
272 Different actions are available depending a file's status.
274 Stage Selected
275 ~~~~~~~~~~~~~~
276 Add to the staging area using `git add <http://git-scm.com/docs/git-add>`_
277 Marks unmerged files as resolved.
279 Launch Editor
280 ~~~~~~~~~~~~~
281 Launches the configured visual text editor
283 Launch Difftool
284 ~~~~~~~~~~~~~~~
285 Visualize changes using `git difftool`.
287 Revert Unstaged Edits
288 ~~~~~~~~~~~~~~~~~~~~~
289 Reverts unstaged content by checking out selected paths
290 from the index/staging area
292 Revert Uncommitted Edits
293 ~~~~~~~~~~~~~~~~~~~~~~~~
294 Throws away uncommitted edits
296 Unstage Selected
297 ~~~~~~~~~~~~~~~~
298 Remove from the index/staging area with
299 `git reset <http://git-scm.com/docs/git-reset>`_
301 Launch Merge Tool
302 ~~~~~~~~~~~~~~~~~
303 Resolve conflicts using `git mergetool <http://git-scm.com/docs/git-mergetool>`_.
305 Delete File(s)
306 ~~~~~~~~~~~~~~
307 Delete untracked files from the filesystem.
309 Add to .gitignore
310 ~~~~~~~~~~~~~~~~~
311 Adds untracked files to to the .gitignore file.
314 .. _diff:
316 DIFF
317 ====
318 The diff viewer/editor displays diffs for selected files.
319 Additions are shown in green and removals are displayed in light red.
320 Extraneous whitespace is shown with a pure-red background.
322 Right-clicking in the diff provides access to additional actions
323 that use either the cursor location or text selection.
325 The "Copy Diff" action at ``Alt + Shift + C`` copies the selected lines to the
326 clipboard. The ``+``, ``-`` and `` `` diff line prefixes are stripped from each line
327 when copying diffs using the "Copy Diff" action.
329 Staging content for commit
330 --------------------------
331 The ``@@`` patterns denote a new diff hunk.  Selecting lines of diff
332 and using the `Stage Selected Lines` command will stage just the selected
333 lines.  Clicking within a diff hunk and selecting `Stage Diff Hunk` stages the
334 entire patch diff hunk.
336 The corresponding opposite commands can be performed on staged files as well,
337 e.g. staged content can be selectively removed from the index when we are
338 viewing diffs for staged content.
340 Diff Against Commit (Diff Mode)
341 -------------------------------
342 *Diff Mode* allows you to selectively unstage and revert edits from arbitrary commits
343 so that you can bring these edits back into your worktree.
345 You can use the diff editor to unstage edits against arbitrary commits by using the
346 ``Diff > Against Commit... (Diff Mode)`` menu action.
348 You can exit *Diff Mode* by clicking on the red circle-slash icon on the Status
349 widget, by using the ``Diff > Exit Diff mode`` menu action, or by clicking in
350 an empty area in the `Status` tool.
353 COMMIT MESSAGE EDITOR
354 =====================
355 The commit message editor is a simple text widget
356 for entering commit messages.
358 You can navigate between the `Subject` and `Extended description...`
359 fields using the keyboard arrow keys.
361 Pressing enter when inside the `Subject` field jumps down to the
362 extended description field.
364 The `Options` button menu to the left of the subject field
365 provides access to the additional actions.
367 The `Ctrl+i` keyboard shortcut adds a standard "Signed-off-by: " line,
368 and `Ctrl+Enter` creates a new commit using the commit message and
369 staged content.
371 Sign Off
372 --------
373 The `Sign Off` button adds a standard::
375     Signed-off-by: A. U. Thor <a.u.thor@example.com>
377 line to the bottom of the commit message.
379 Invoking this action is equivalent to passing the ``-s`` option
380 to `git commit <http://git-scm.com/docs/git-commit>`_.
382 Commit
383 ------
384 The commit button runs
385 `git commit <http://git-scm.com/docs/git-commit>`_.
386 The contents of the commit message editor is provided as the commit message.
388 Only staged files are included in the commit -- this is the same behavior
389 as running ``git commit`` on the command-line.
391 Line and Column Display
392 -----------------------
393 The current line and column number is displayed by the editor.
394 E.g. a ``5,0`` display means that the cursor is located at
395 line five, column zero.
397 The display changes colors when lines get too long.
398 Yellow indicates the safe boundary for sending patches to a mailing list
399 while keeping space for inline reply markers.
401 Orange indicates that the line is starting to run a bit long and should
402 break soon.
404 Red indicates that the line is running up against the standard
405 80-column limit for commit messages.
407 Keeping commit messages less than 76-characters wide is encouraged.
408 `git log <http://git-scm.com/docs/git-log>`_
409 is a great tool but long lines mess up its formatting for everyone else,
410 so please be mindful when writing commit messages.
412 Amend Last Commit
413 -----------------
414 Clicking on `Amend Last Commit` makes `git cola` amend the previous commit
415 instead of creating a new one.  `git cola` loads the previous commit message
416 into the commit message editor when this option is selected.
418 The `Status` tool will display all of the changes for the amended commit.
420 Create Signed Commit
421 --------------------
422 Tell `git commit` and `git merge` to sign commits using GPG.
424 Using this option is equivalent to passing the ``--gpg-sign`` option to
425 `git commit <http://git-scm.com/docs/git-commit>`_ and
426 `git merge <http://git-scm.com/docs/git-merge>`_.
428 This option's default value can be configured using the `cola.signcommits`
429 configuration variable.
431 Prepare Commit Message
432 ----------------------
433 The ``Commit -> Prepare Commit Message`` action or `Ctrl-Shift-Return` keyboard shortcut
434 runs the `cola-prepare-commit-msg` hook if it is available in `.git/hooks/`.
435 This is a `git cola`-specific hook that takes the same parameters
436 as Git's `prepare-commit-msg hook <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_
438 The hook is passed the path to `.git/GIT_COLA_MSG` as the first argument and the hook is expected to write
439 an updated commit message to specified path.  After running this action, the
440 commit message editor is updated with the new commit message.
442 To override the default path to this hook set the
443 `cola.prepareCommitMessageHook` `git config` variable to the path to the
444 hook script.  This is useful if you would like to use a common hook
445 across all repositories.
448 BRANCHES
449 ========
450 The `Branches` tool provides a visual tree to navigate through the branches.
451 The tree has three main nodes `Local Branch`, `Remote Branch` and `Tags`.
452 Branches are grouped by their name divided by the character '/'.Ex::
454     branch/feature/foo
455     branch/feature/bar
456     branch/doe
458 Will produce::
460     branch
461         - doe
462         + feature
463             - bar
464             - foo
466 Current branch will display a star icon. If current branch has commits
467 ahead/behind it will display an up/down arrow with its number.
469 Actions
470 -------
471 Various actions are available through the right-click context menu.
472 Different actions are available depending of selected branch status.
474 Checkout
475 ~~~~~~~~
476 The checkout action runs
477 `git checkout [<branchname>] <https://git-scm.com/docs/git-checkout>`_.
479 Merge in current branch
480 ~~~~~~~~~~~~~~~~~~~~~~~
481 The merge action runs
482 `git merge --no-commit [<branchname>] <https://git-scm.com/docs/git-merge>`_.
484 Pull
485 ~~~~
486 The pull action runs
487 `git pull --no-ff [<remote>] [<branchname>] <https://git-scm.com/docs/git-pull>`_.
489 Push
490 ~~~~
491 The push action runs
492 `git push [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
494 Rename Branch
495 ~~~~~~~~~~~~~
496 The rename branch action runs
497 `git branch -M [<branchname>] <https://git-scm.com/docs/git-push>`_.
499 Delete Branch
500 ~~~~~~~~~~~~~
501 The delete branch branch action runs
502 `git branch -D [<branchname>] <https://git-scm.com/docs/git-branch>`_.
504 Delete Remote Branch
505 ~~~~~~~~~~~~~~~~~~~~
506 The remote branch action runs
507 `git push --delete [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
510 APPLY PATCHES
511 =============
512 Use the ``File -> Apply Patches`` menu item to begin applying patches.
514 Dragging and dropping patches onto the `git cola` interface
515 adds the patches to the list of patches to apply using
516 `git am <http://git-scm.com/docs/git-am>`_.
518 You can drag either a set of patches or a directory containing patches.
519 Patches can be sorted using in the interface and are applied in the
520 same order as is listed in the list.
522 When a directory is dropped `git cola` walks the directory
523 tree in search of patches.  `git cola` sorts the list of
524 patches after they have all been found.  This allows you
525 to control the order in which patches are applied by placing
526 patchsets into alphanumerically-sorted directories.
529 CUSTOM WINDOW SETTINGS
530 ======================
531 `git cola` remembers modifications to the layout and arrangement
532 of tools within the `git cola` interface.  Changes are saved
533 and restored at application shutdown/startup.
535 `git cola` can be configured to not save custom layouts by unsetting
536 the `Save Window Settings` option in the `git cola` preferences.
539 DARK MODE AND WINDOW MANAGER THEMES
540 ===================================
541 Git Cola contains a ``default`` theme which follows the current Qt style and a
542 handful of built-in color themes.  See :ref:`cola_theme` for more details.
544 To use icons appropriate for a dark application theme, configure
545 ``git config --global cola.icontheme dark`` to use the dark icon theme.
546 See :ref:`cola_icontheme` for more details.
548 On macOS, using the ``default`` theme will automatically inherit "Dark Mode"
549 color themes when configured via System Preferences.  You will need to
550 configure the dark icon theme as noted above when dark mode is enabled.
552 On Linux, you may want Qt to follow the Window manager theme by configuring it
553 to do so using the ``qt5ct`` Qt5 configuration tool.  Install ``qt5ct`` on
554 Debian/Ubuntu systems to make this work.::
556     sudo apt install qt5ct
558 Once installed, update your `~/.bash_profile` to activate ``qt5ct``::
560     # Use the style configured using the qt5ct tool
561     export QT_QPA_PLATFORMTHEME=qt5ct
563 This only work with the `default` theme.  The other themes replace the color
564 palette with theme-specific colors.
566 Some systems may require that you override `QT_STYLE_OVERRIDE` in order to
567 use a dark theme or to better interact with the Desktop environment.
568 Some systems provide a theme that you can install::
570     sudo apt-get install adwaita-qt
572 You can activate the theme using the following environment variable::
574     # Override the default theme to adwaita-dark
575     export QT_STYLE_OVERRIDE=adwaita-dark
577 `QT_STYLE_OVERRIDE` may already be set in your Desktop Environment, so check that
578 variable for reference if you get unexpected hangs when launching `git-cola` or
579 when the default theme does not follow the desktop's theme on Linux.
581 If you don't want to set this variable globally then you can set it when launching
582 cola from the command-line::
584     QT_STYLE_OVERRIDE=adwaita-dark git cola
586 The following is a user-contributed custom `git-cola.desktop` file that can be used to
587 launch Git Cola with these settings preset for you::
589     [Desktop Entry]
590     Name=Git Cola (dark)
591     Comment=The highly caffeinated Git GUI
592     TryExec=git-cola
593     Exec=env QT_STYLE_OVERRIDE=adwaita-dark git-cola --prompt --icon-theme dark
594     Icon=git-cola
595     StartupNotify=true
596     Terminal=false
597     Type=Application
598     Categories=Development;RevisionControl;
599     X-KDE-SubstituteUID=false
601 You may also want to customize the diff colors when using a dark theme::
603     git config --global cola.color.add 86c19f
604     git config --global cola.color.remove c07067
606 Please see `#760 <https://github.com/git-cola/git-cola/issues/760>`_ for more details.
608 Custom Themes
609 -------------
610 To create your own custom theme for Git Cola just create a QSS file and put it in
611 ``~/.config/themes/``. You can add as many files as you want. Each file will become
612 an option in ``Menu -> File -> Preferences -> Appearance -> GUI theme``.
614 Some examples can be found here `Qt Style Sheets Examples <https://doc.qt.io/qt-5/stylesheet-examples.html>`_.
617 CONFIGURATION VARIABLES
618 =======================
619 These variables can be set using `git config` or from the settings.
621 cola.autocompletepaths
622 ----------------------
623 Set to `false` to disable auto-completion of filenames in completion widgets.
624 This can speed up operations when working in large repositories.
625 Defaults to `true`.
627 cola.autoloadCommitTemplate
628 ---------------------------
629 Set to `true` to automatically load the commit template in the commit message
630 editor If the commit.template variable has not been configured, raise the
631 corresponding error.
632 Defaults to `false`.
634 cola.blameviewer
635 ----------------
636 The command used to blame files.  Defaults to `git gui blame`.
638 cola.blockcursor
639 ----------------
640 Whether to use a "block" cursor in diff editors. The block cursor is easier to
641 see compared to a line cursor. Set to `false` to use a thin "line" cursor.
642 Defauls to `true`.
644 cola.browserdockable
645 --------------------
646 Whether to create a dock widget with the `Browser` tool.
647 Defaults to `false` to speedup startup time.
649 cola.checkconflicts
650 -------------------
651 Inspect unmerged files for conflict markers before staging them.
652 This feature helps prevent accidental staging of unresolved merge conflicts.
653 Defaults to `true`.
655 cola.defaultrepo
656 ----------------
657 `git cola`, when run outside of a Git repository, prompts the user for a
658 repository.  Set `cola.defaultrepo` to the path of a Git repository to make
659 `git cola` attempt to use that repository before falling back to prompting
660 the user for a repository.
662 cola.dictionary
663 ---------------
664 Specifies an additional dictionary for `git cola` to use in its spell checker.
665 This should be configured to the path of a newline-separated list of words.
667 By default, `git cola` searches for `dict/words` and `dict/propernames` dictionary
668 files in `~/.local/share` and `$XDG_DATA_DIRS`.
670 If `$XDG_DATA_DIRS` is undefined or set to an empty value then `/usr/local/share` and
671 `/usr/share` are searched for dictionary files.
673 Dictionary files are newline-separated and contain one word per line.
675 cola.expandtab
676 --------------
677 Expand tabs into spaces in the commit message editor.  When set to `true`,
678 `git cola` will insert a configurable number of spaces when tab is pressed.
679 The number of spaces is determined by `cola.tabwidth`.
680 Defaults to `false`.
682 cola.gravatar
683 -------------
684 Use the `gravatar.com` service to lookup icons for author emails.
685 Gravatar icons work by sending an MD5 hash of an author's email to `gravatar.com`
686 when requesting an icon. Warning: this feature can leak information.
687 Network requests to `gravatar.com` are disabled when set to `false`.
688 Defaults to `true`.
690 cola.fileattributes
691 -------------------
692 Enables per-file gitattributes encoding and binary file support.
693 This tells `git cola` to honor the configured encoding when displaying
694 and applying diffs.
696 A `.gitattributes` file can set the ``binary`` attribute in order to force
697 specific untracked paths to be treated as binary files when diffing.
698 Binary files are displayed using a hexdump display.
700 .. sourcecode:: sh
702    # Treat *.exr files as binary files.
703    *.exr binary
705 cola.fontdiff
706 -------------
707 Specifies the font to use for `git cola`'s diff display.
709 cola.hidpi
710 ----------
711 Specifies the High DPI displays scale factor. Set `0` to automatically scaled.
712 Setting value between 0 and 1 is undefined.
713 This option requires at least Qt 5.6 to work.
714 See `Qt QT_SCALE_FACTOR documentation <https://doc.qt.io/qt-5/highdpi.html>`_
715 for more information.
717 .. _cola_icontheme:
719 cola.icontheme
720 --------------
721 Specifies the icon themes to use throughout `git cola`. The theme specified
722 must be the name of the subdirectory containing the icons, which in turn must
723 be placed in the inside the main "icons" directory in `git cola`'s
724 installation prefix.
726 If unset, or set either "light" or "default", then the default style will be
727 used.  If set to "dark" then the built-in "dark" icon theme, which is
728 suitable for a dark window manager theme, will be used.
730 If set to an absolute directory path then icons in that directory will be used.
731 This value can be set to multiple values using,
732 ``git config --add cola.icontheme $theme``.
734 This setting can be overridden by the `GIT_COLA_ICON_THEME` environment
735 variable, which can specify multiple themes using a colon-separated value.
737 The icon theme can also be specified by passing ``--icon-theme=<theme>`` on the
738 command line, once for each icon theme, in the order that they should be
739 searched.  This can be used to override a subset of the icons, and fallback
740 to the built-in icons for the remainder.
742 cola.imagediff.[extension]
743 --------------------------
744 Enable image diffs for the specified file extension.  For example, configuring
745 `git config --global cola.imagediff.svg false` will disable use of the visual
746 image diff for `.svg` files in all repos until is is explicitly toggled on.
747 Defaults to `true`.
749 cola.inotify
750 ------------
751 Set to `false` to disable file system change monitoring.  Defaults to `true`,
752 but also requires either Linux with inotify support or Windows with `pywin32`
753 installed for file system change monitoring to actually function.
755 cola.refreshonfocus
756 -------------------
757 Set to `true` to automatically refresh when `git cola` gains focus.  Defaults
758 to `false` because this can cause a pause whenever switching to `git cola` from
759 another application.
761 cola.linebreak
762 --------------
763 Whether to automatically break long lines while editing commit messages.
764 Defaults to `true`.  This setting is configured using the `Preferences`
765 dialog, but it can be toggled for one-off usage using the commit message
766 editor's options sub-menu.
768 cola.logdate
769 ------------
770 Set the default date-time mode for the DAG display. This value is
771 passed to `git log --date=<format>`.
772 See `git log(1) <https://git-scm.com/docs/git-log#Documentation/git-log.txt---dateltformatgt>`_
773 for more details.
775 cola.maxrecent
776 --------------
777 `git cola` caps the number of recent repositories to avoid cluttering
778 the start and recent repositories menu.  The maximum number of repositories to
779 remember is controlled by `cola.maxrecent` and defaults to `8`.
781 cola.mousezoom
782 --------------
783 Controls whether zooming text using Ctrl + MouseWheel scroll is enabled.
784 Set to `false to disable scrolling with the mouse wheel.
785 Defauls to `true`.
787 cola.dragencoding
788 -----------------
789 `git cola` encodes paths dragged from its widgets into `utf-16` when adding
790 them to the drag-and-drop mime data (specifically, the `text/x-moz-url` entry).
791 `utf-16` is used to make `gnome-terminal` see the right paths, but other
792 terminals may expect a different encoding.  If you are using a terminal that
793 expects a modern encoding, e.g. `terminator`, then set this value to `utf-8`.
795 cola.readsize
796 -------------
797 `git cola` avoids reading large binary untracked files.
798 The maximum size to read is controlled by `cola.readsize`
799 and defaults to `2048`.
801 cola.resizebrowsercolumns
802 -------------------------
803 `git cola` will automatically resize the file browser columns as folders are
804 expanded/collapsed when ``cola.resizebrowsercolumns`` is set to `true`.
806 cola.patchesdirectory
807 ---------------------
808 The default directory to use when exporting patches. Relative paths are treated
809 as being relative to the current repository. Absolute paths are used as-is.
810 Defaults to `patches`.
812 cola.safemode
813 -------------
814 The "Stage" button in the `git cola` Actions panel stages all files when it is
815 activated and no files are selected.  This can be problematic if it is
816 accidentally triggered after carefully preparing the index with staged
817 changes.  "Safe Mode" is enabled by setting `cola.safemode` to `true`.
818 When enabled, `git cola` will do nothing when "Stage" is activated without a
819 selection.  Defaults to `false`.
821 cola.savewindowsettings
822 -----------------------
823 `git cola` will remember its window settings when set to `true`.
824 Window settings and X11 sessions are saved in `$HOME/.config/git-cola`.
826 cola.showpath
827 -------------
828 `git cola` displays the absolute path of the repository in the window title.
829 This can be disabled by setting `cola.showpath` to `false`.
830 Defaults to `true`.
832 cola.signcommits
833 ----------------
834 `git cola` will sign commits by default when set `true`. Defaults to `false`.
835 See the section below on setting up GPG for more details.
837 cola.startupmode
838 ----------------
839 Control how the list of repositories is displayed in the startup dialog.
840 Set to `list` to view the list of repositories as a list, or `folder` to view
841 the list of repositories as a collection of folder icons.
842 Defaults to `list`.
844 cola.statusindent
845 -----------------
846 Set to `true` to indent files in the Status widget.  Files in the `Staged`,
847 `Modified`, etc. categories will be grouped in a tree-like structure.
848 Defaults to `false`.
850 cola.statusshowtotals
851 ---------------------
852 Set to `true` to display files counts in the Status widget's category titles.
853 Defaults to `false`.
855 cola.tabwidth
856 -------------
857 The number of columns occupied by a tab character.  Defaults to 8.
859 cola.terminal
860 -------------
861 The command to use when launching commands within a graphical terminal.
863 `cola.terminal` defaults to `xterm -e` when unset.
864 e.g. when opening a shell, `git cola` will run `xterm -e $SHELL`.
866 `git cola` has built-in support for `xterm`, `gnome-terminal`, `konsole`.
867 If either `gnome-terminal`, `xfce4-terminal`, or `konsole` are installed
868 then they will be preferred over `xterm` when `cola.terminal` is unset.
870 The table below shows the built-in values that are used for the respective
871 terminal.  You can force the use of a specific terminal by configuring cola
872 accordingly.
874 cola.terminalshellquote
875 -----------------------
876 Some terminal require that the command string get passed as a string.
877 For example, ``xfce4-terminal -e "git difftool"`` requires shell quoting,
878 whereas ``gnome-terminal -- git difftool`` does not.
880 You should not need to set this variable for the built-in terminals
881 cola knows about -- it will behave correctly without configuration.
882 For example, when unconfigured, cola already knows that xfce4-terminal
883 requires shell quoting.
885 This configuration variable is for custom terminals outside of the builtin set.
886 The table below shows the builtin configuration.
888 .. code-block:: text
890     Terminal            cola.terminal           cola.terminalshellquote
891     --------            -------------           -----------------------
892     gnome-terminal      "gnome-terminal --"     false
893     konsole             "konsole -e"            false
894     xfce4-terminal      "xfce4-terminal -e"     true
895     xterm               "xterm -e"              false
898 cola.textwidth
899 --------------
900 The number of columns used for line wrapping.
901 Tabs are counted according to `cola.tabwidth`.
903 .. _cola_theme:
905 cola.theme
906 ----------
907 Specifies the GUI theme to use throughout `git cola`. The theme specified
908 must be one of the following values:
910 * `default` â€“ default Qt theme, may appear different on various systems
911 * `flat-dark-blue`
912 * `flat-dark-green`
913 * `flat-dark-grey`
914 * `flat-dark-red`
915 * `flat-light-blue`
916 * `flat-light-green`
917 * `flat-light-grey`
918 * `flat-light-red`
920 If unset, or set to an invalid value, then the default style will be
921 used. The `default` theme is generated by Qt internal engine and should look
922 native but may look noticeably different on different platforms. The flat
923 themes on the other hand should look similar (but not identical) on various
924 systems.
926 The GUI theme can also be specified by passing ``--theme=<name>`` on the
927 command line.
929 cola.turbo
930 ----------
931 Set to `true` to enable "turbo" mode.  "Turbo" mode disables some
932 features that can slow things down when operating on huge repositories.
933 "Turbo" mode will skip loading Git commit messages, author details, status
934 information, and commit date details in the `File Browser` tool.
935 Defaults to `false`.
937 cola.color.text
938 ---------------
939 The default diff text color, in hexadecimal #RRGGBB notation.
940 Defaults to "#030303"::
942     git config cola.color.text '#030303'
944 cola.color.add
945 --------------
946 The default diff "add" background color, in hexadecimal #RRGGBB notation.
947 Defaults to "#d2ffe4"::
949     git config cola.color.add '#d2ffe4'
951 cola.color.remove
952 -----------------
953 The default diff "remove" background color, in hexadecimal #RRGGBB notation.
954 Defaults to "#fee0e4"::
956     git config cola.color.remove '#fee0e4'
958 cola.color.header
959 -----------------
960 The default diff header text color, in hexadecimal #RRGGBB notation.
961 Defaults to "#bbbbbb"::
963     git config cola.color.header '#bbbbbb'
965 commit.cleanup
966 --------------
967 Configure whether commit messages should be stripped of whitespace and comments.
969 Valid values are ``strip``, ``whitespace``, ``verbatim``, ``scissors`` or ``default``.
971 The ``default`` mode uses the ``whitespace`` mode when committing through Git Cola
972 and the ``strip`` mode when committing using the ``git commit`` command-line.
974 * ``strip`` - Strip leading and trailing empty lines, trailing whitespace,
975   commentary and collapse consecutive empty lines.
977 * ``whitespace`` - Same as strip except ``# commentary`` is not removed.
978   This is the ``default`` behavior when committing through `Git Cola`.
980 * ``verbatim`` - Do not change the message at all.
982 * ``scissors`` - Same as whitespace except that everything from (and including)
983   the line found below is truncated, if the message is to be edited.
984   "#" can be customized with ``core.commentChar``::
986     # ------------------------ >8 ------------------------
987     Scissor-lines and all following lines are removed.
989 Changing the mode to ``whitespace`` can be useful when you always want to keep
990 lines that begin with comment character ``#`` in your log message, even when
991 committing using the command-line ``git commit``.
993 On the contrary, if you always want to always strip comments, even when
994 committing through Git Cola, then configure ``commit.cleanup`` to ``strip``.
996 Please see the `git commit cleanup mode documentation
997 <https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---cleanupltmodegt>`_
998 for more details.
1000 core.commentChar
1001 ----------------
1002 Commit messages can contain comments that start with this character.
1003 Defaults to ``#``.
1005 Please see the `git config documentation
1006 <https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar>`_
1007 for more details.
1009 core.hooksPath
1010 --------------
1011 Hooks are programs you can place in a hooks directory to trigger actions at
1012 certain points in git’s execution. Hooks that don’t have the executable bit
1013 set are ignored.
1015 By default the hooks directory is ``$GIT_DIR/hooks``, but that can
1016 be changed via the ``core.hooksPath`` configuration variable
1018 The ``cola-prepare-commit-msg`` hook functionality and Cola's Git LFS
1019 detection honors this configuration.
1021 Please see the `git hooks documentation <https://git-scm.com/docs/githooks>`_
1022 for more details.
1024 gui.diffcontext
1025 ---------------
1026 The number of diff context lines to display.
1028 gui.displayuntracked
1029 --------------------
1030 `git cola` avoids showing untracked files when set to `false`.
1032 gui.editor
1033 ----------
1034 The default text editor to use is defined in `gui.editor`.
1035 The config variable overrides the VISUAL environment variable.
1036 e.g. `gvim -f -p`.
1038 gui.historybrowser
1039 ------------------
1040 The history browser to use when visualizing history.
1041 Defaults to `gitk`.
1043 diff.tool
1044 ---------
1045 The default diff tool to use.
1047 merge.tool
1048 ----------
1049 The default merge tool to use.
1051 user.email
1052 ----------
1053 Your email address to be recorded in any newly created commits.
1054 Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
1055 'EMAIL' environment variables.
1057 user.name
1058 ---------
1059 Your full name to be recorded in any newly created commits.
1060 Can be overridden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'
1061 environment variables.
1064 ENVIRONMENT VARIABLES
1065 =====================
1067 GIT_COLA_ICON_THEME
1068 -------------------
1069 When set in the environment, `GIT_COLA_ICON_THEME` overrides the
1070 theme specified in the `cola.icontheme` configuration.
1071 Read :ref:`cola_icontheme` for more details.
1073 GIT_COLA_SCALE
1074 --------------
1075 .. Important:: `GIT_COLA_SCALE` should not be used with newer versions of Qt.
1077     Set `QT_AUTO_SCREEN_SCALE_FACTOR` to `1` and Qt will automatically
1078     scale the interface to the correct size based on the display DPI.
1079     This option is also available by setting `cola.hidpi` configuration.
1081     See the `Qt High DPI documentation <https://doc.qt.io/qt-5/highdpi.html>`_
1082     for more details.
1084 `git cola` can be made to scale its interface for HiDPI displays.
1085 When defined, `git cola` will scale icons, radioboxes, and checkboxes
1086 according to the scale factor.  The default value is `1`.
1087 A good value is `2` for high-resolution displays.
1089 Fonts are not scaled, as their size can already be set in the settings.
1091 GIT_COLA_TRACE
1092 --------------
1093 When defined, `git cola` logs `git` commands to stdout.
1094 When set to `full`, `git cola` also logs the exit status and output.
1095 When set to `trace`, `git cola` logs to the `Console` widget.
1097 VISUAL
1098 ------
1099 Specifies the default editor to use.
1100 This is ignored when the `gui.editor` configuration variable is defined.
1102 LANGUAGE SETTINGS
1103 =================
1104 `git cola` automatically detects your language and presents some
1105 translations when available.  This may not be desired, or you
1106 may want `git cola` to use a specific language.
1108 You can make `git cola` use an alternative language by creating a
1109 `~/.config/git-cola/language` file containing the standard two-letter
1110 gettext language code, e.g. "en", "de", "ja", "zh", etc.::
1112     mkdir -p ~/.config/git-cola &&
1113     echo en >~/.config/git-cola/language
1115 Alternatively you may also use LANGUAGE environmental variable to temporarily
1116 change `git cola`'s language just like any other gettext-based program.  For
1117 example to temporarily change `git cola`'s language to English::
1119     LANGUAGE=en git cola
1121 To make `git cola` use the zh_TW translation with zh_HK, zh, and en as a
1122 fallback.::
1124     LANGUAGE=zh_TW:zh_HK:zh:en git cola
1127 CUSTOM GUI ACTIONS
1128 ==================
1129 `git cola` allows you to define custom GUI actions by setting `git config`
1130 variables.  The "name" of the command appears in the "Actions" menu.
1132 guitool.<name>.cmd
1133 ------------------
1134 Specifies the shell command line to execute when the corresponding item of the
1135 Tools menu is invoked. This option is mandatory for every tool. The command is
1136 executed from the root of the working directory, and in the environment it
1137 receives the name of the tool as GIT_GUITOOL, the name of the currently
1138 selected file as FILENAME, and the name of the current branch as CUR_BRANCH
1139 (if the head is detached, CUR_BRANCH is empty).
1141 If ``<name>`` contains slashes (``/``) then the leading part of the name,
1142 up until the final slash, is treated like a path of submenus under which the
1143 actions will be created.
1145 For example, configuring ``guitool.Commands/Util/echo.cmd`` creates a
1146 ``Commands`` menu inside the top-level ``Actions`` menu, a ``Util`` menu
1147 inside the ``Commands`` menu and an ``echo`` action inside the ``Commands``
1148 submenu.
1150 guitool.<name>.background
1151 -------------------------
1152 Run the command in the background (similar to editing and difftool actions).
1153 This avoids blocking the GUI.  Setting `background` to `true` implies
1154 `noconsole` and `norescan`.
1156 guitool.<name>.needsfile
1157 ------------------------
1158 Run the tool only if a diff is selected in the GUI. It guarantees that
1159 FILENAME is not empty.
1161 guitool.<name>.noconsole
1162 ------------------------
1163 Run the command silently, without creating a window to display its output.
1165 guitool.<name>.norescan
1166 -----------------------
1167 Don’t rescan the working directory for changes after the tool finishes
1168 execution.
1170 guitool.<name>.confirm
1171 ----------------------
1172 Show a confirmation dialog before actually running the tool.
1174 guitool.<name>.argprompt
1175 ------------------------
1176 Request a string argument from the user, and pass it to the tool through the
1177 ARGS environment variable. Since requesting an argument implies confirmation,
1178 the confirm option has no effect if this is enabled. If the option is set to
1179 true, yes, or 1, the dialog uses a built-in generic prompt; otherwise the
1180 exact value of the variable is used.
1182 guitool.<name>.revprompt
1183 ------------------------
1184 Request a single valid revision from the user, and set the REVISION
1185 environment variable. In other aspects this option is similar to argprompt,
1186 and can be used together with it.
1188 guitool.<name>.revunmerged
1189 --------------------------
1190 Show only unmerged branches in the revprompt subdialog. This is useful for
1191 tools similar to merge or rebase, but not for things like checkout or reset.
1193 guitool.<name>.title
1194 --------------------
1195 Specifies the title to use for the prompt dialog.
1196 Defaults to the tool name.
1198 guitool.<name>.prompt
1199 ---------------------
1200 Specifies the general prompt string to display at the top of the dialog,
1201 before subsections for argprompt and revprompt.
1202 The default value includes the actual command.
1204 guitool.<name>.shortcut
1205 -----------------------
1206 Specifies a keyboard shortcut for the custom tool.
1208 The value must be a valid string understood by the `QAction::setShortcut()` API.
1209 See http://qt-project.org/doc/qt-4.8/qkeysequence.html#QKeySequence-2
1210 for more details about the supported values.
1212 Avoid creating shortcuts that conflict with existing built-in `git cola`
1213 shortcuts.  Creating a conflict will result in no action when the shortcut
1214 is used.
1217 SETTING UP CREDENTIAL HELPERS
1218 =============================
1219 Git has robust support for automatically handling credentials.
1221 The recommended approach is to use SSH keys and an SSH agent, but any of the core Git
1222 Credentials helpers will get used automatically by Git Cola.
1224 See https://git-scm.com/doc/credential-helpers for more details.
1227 SETTING UP GPG FOR SIGNED COMMITS
1228 =================================
1229 When creating signed commits, `gpg` will attempt to read your password from the
1230 terminal from which `git cola` was launched.
1231 The way to make this work smoothly is to use a GPG agent so that you can avoid
1232 needing to re-enter your password every time you commit.
1234 This also gets you a graphical passphrase prompt instead of getting prompted
1235 for your password in the terminal.
1237 Install gpg-agent and friends
1238 -----------------------------
1239 On Mac OS X, you may need to `brew install gpg-agent` and install the
1240 `Mac GPG Suite <https://gpgtools.org/macgpg2/>`_.
1242 On Linux use your package manager to install gnupg2,
1243 gnupg-agent and pinentry-qt, e.g.::
1245     sudo apt-get install gnupg2 gnupg-agent pinentry-qt
1247 On Linux, you should also configure Git so that it uses gpg2 (gnupg2),
1248 otherwise you will get errors mentioning, "unable to open /dev/tty".
1249 Set Git's `gpg.program` to `gpg2`::
1251     git config --global gpg.program gpg2
1253 Configure gpg-agent and a pin-entry program
1254 -------------------------------------------
1255 On Mac OS X, edit `~/.gnupg/gpg.conf` to include the line,::
1257     use-agent
1259 This is typically not needed on Linux, where `gpg2` is used, as
1260 this is the default value when using `gpg2`.
1262 Next, edit `~/.gnupg/gpg-agent.conf` to contain a pinentry-program line
1263 pointing to the pinentry program for your platform.
1265 The following example `~/.gnupg/gpg-agent.conf` shows how to use
1266 pinentry-gtk-2 on Linux::
1268     pinentry-program /usr/bin/pinentry-gtk-2
1269     default-cache-ttl 3600
1271 This following example `.gnupg/gpg-agent.conf` shows how to use MacGPG2's
1272 pinentry app on On Mac OS X::
1274     pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
1275     default-cache-ttl 3600
1276     enable-ssh-support
1277     use-standard-socket
1279 Once this has been set up then you will need to reload your gpg-agent config::
1281     echo RELOADAGENT | gpg-connect-agent
1283 If you see the following output::
1285     OK
1287 Then the daemon is already running, and you do not need to start it yourself.
1289 If it is not running, eval the output of ``gpg-agent --daemon`` in your shell
1290 prior to launching `git cola`.::
1292     eval $(gpg-agent --daemon)
1293     git cola
1296 SHELL COMPLETIONS
1297 =================
1299 Git Cola provides shell completions for zsh and bash.
1300 The completion scripts and instructions are included in Git Cola's
1301 `contrib` directory.
1303 * `Shell completion scripts <https://gitlab.com/git-cola/git-cola/-/tree/main/contrib>`_
1305 * `Setup instructions <https://gitlab.com/git-cola/git-cola/-/blob/main/contrib/README.md>`_
1308 WINDOWS NOTES
1309 =============
1311 Git Installation
1312 ----------------
1313 If Git is installed in a custom location, e.g. not installed in `C:/Git` or
1314 Program Files, then the path to Git must be configured by creating a file in
1315 your home directory `~/.config/git-cola/git-bindir` that points to your git
1316 installation.  e.g.::
1318     C:/Tools/Git/bin
1320 SSH Agents for Key-based Authentication
1321 ---------------------------------------
1322 You may need to setup ssh-agent in order to use SSH key-based authentication
1323 on Windows. It has been reported that starting OpenSSH agent in
1324 Windows Services and adding the key using Powershell are necessary in order
1325 to get things working.
1327 Please see the following links for more details.
1329 https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows
1332 FIPS SECURITY MODE
1333 ==================
1335 `FIPS Security Mode <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation>`_
1336 is available in newer versions of Python. These include Python 3.9+ and the
1337 patched Python 3.6 used by CentOS8/RHEL8 (and possibly others).
1339 Git Cola uses the ``hashlib.md5`` function and adheres to the FIPS security
1340 mode when available. Git Cola does not use the MD5 value for security purposes.
1341 MD5 is used only for the purposes of implementing the ``cola/gravatar.py``
1342 Gravatar client.
1345 LINKS
1346 =====
1348 Git Cola's Git Repository
1349 -------------------------
1350 * `Primary repository <https://gitlab.com/git-cola/git-cola/>_`.
1351 * `Mirror repository <https://github.com/git-cola/git-cola/>_`.
1354 Git Cola Homepage
1355 -----------------
1356 https://git-cola.gitlab.io/