cmds: cleanup unused TODO bits
[git-cola.git] / docs / git-cola.rst
blobc278842529b2a9861e69c1d7e805b6394ce43190
1 ===========
2 git-cola(1)
3 ===========
5 SYNOPSIS
6 ========
7 git cola [options] [sub-command]
9 DESCRIPTION
10 ===========
11 Git Cola is a sleek and powerful Git GUI.
13 OPTIONS
14 =======
16 ``--amend``
17 -----------
18 Start `git cola` in amend mode.
20 ``--prompt``
21 ------------
22 Prompt for a Git repository.  Defaults to the current directory.
24 ``-r, --repo <path>``
25 ---------------------
26 Open the Git repository at `<path>`.  Defaults to the current directory.
28 ``-s, --status-filter <filter>``
29 --------------------------------
30 Apply the path filter to the status widget.
32 ``--version``
33 -------------
34 Print the `git cola` version and exit.
36 ``-h, --help``
37 --------------
38 Show usage and optional arguments.
40 ``--help-commands``
41 -------------------
42 Show available sub-commands.
44 SUB-COMMANDS
45 ============
49 Apply patches.
51 archive
52 -------
53 Export tarballs from Git.
55 branch
56 ------
57 Create branches.
59 browse
60 ------
61 Browse tracked files.
63 config
64 ------
65 Configure settings.
67 dag
68 ---
69 Start the `git dag` Git history browser.
71 diff
72 ----
73 Diff changed files.
75 fetch
76 -----
77 Fetch history from remote repositories.
79 grep
80 ----
81 Use `git grep` to search for content.
83 merge
84 -----
85 Merge branches.
87 pull
88 ----
89 Fetch and merge remote branches.
91 push
92 ----
93 Push branches to remotes.
95 rebase
96 ------
97 Start an interactive rebase.
99 remote
100 ------
101 Create and edit remotes.
103 search
104 ------
105 Search for commits.
107 stash
108 -----
109 Stash uncommitted modifications.
113 Create tags.
115 version
116 -------
117 Print the `git cola` version.
119 CONFIGURE YOUR EDITOR
120 =====================
121 The editor used by `Ctrl-e` is configured from the Preferences screen.
123 The following environment variables are consulted when no editor is configured.
124 If defined, the first of these variables is used:
126 * `GIT_VISUAL`
127 * `VISUAL`
128 * `GIT_EDITOR`
129 * `EDITOR`
131 The `*VISUAL` variables are consulted before the `*EDITOR` variables so that you can
132 configure a graphical editor independently of the editor used by the Git CLI.
134 *ProTip*: Configuring your editor to `gvim -f -p` will open multiple tabs
135 when editing files.  `gvim -f -o` uses splits.
137 `git cola` is {vim, emacs, textpad, notepad++}-aware.
138 When you select a line in the diff or grep screens and press any of
139 `Enter`, `Ctrl-e`, or the `Edit` button, you are taken to that exact line.
141 The editor preference is saved in the `gui.editor` variable using
142 `git config <http://git-scm.com/docs/git-config>`_.
144 The following are some recommend editor configurations.
146 * Neovim + Neovim-Qt
148 .. sourcecode:: sh
150    git config --global core.editor nvim
151    git config --global gui.editor 'nvim-qt --nofork'
153 * Vim + gvim
155 .. sourcecode:: sh
157    git config --global core.editor vim
158    git config --global gui.editor 'gvim -f'
160 * Sublime Text
162 .. sourcecode:: sh
164    git config --global gui.editor 'subl --wait'
167 KEYBOARD SHORTCUTS
168 ==================
169 `git cola` has many useful keyboard shortcuts.
171 Many of `git cola`'s editors understand vim-style hotkeys, eg. `{h,j,k,l}`
172 for navigating in the diff, status, grep, and file browser widgets.
174 `{d,u}` move down/up one half page at a time (similar to vim's `ctrl-{d,u}`).
175 The `space` and `shift-space` hotkeys are mapped to the same operations.
177 `Shift-{j,k,d,u,f,b,page-up,page-down,left,right,up,down}` can be be used in
178 the diff editor to select lines while navigating.
180 `s` is a useful hotkey in the diff editor.  It stages/unstages the current
181 selection when a selection is present.  When nothing is selected, the
182 diff hunk at the current text cursor position is staged.  This makes it very
183 easy to review changes by selecting good hunks with `s` while navigating down
184 and over hunks that are not going to be staged.
186 `Ctrl-u` in the diff editor reverts unstaged edits, and respects the
187 selection.  This is useful for selectively reverted edits from the worktree.
188 This same hotkey reverts the entire file when used from the status tool.
190 `Ctrl-s` in the diff editor and status tools stages/unstages the entire file.
192 You can see the available shortcuts by pressing pressing the ``?`` key,
193 choosing ``Help -> Keyboard shortcuts`` from the main menu,
194 or by consulting the `git cola keyboard shortcuts reference <https://git-cola.github.io/share/doc/git-cola/hotkeys.html>`_.
196 TOOLS
197 =====
198 The `git cola` interface is composed of various cooperating tools.
199 Double-clicking a tool opens it in its own subwindow.
200 Dragging it around moves and places it within the main window.
202 Tools can be hidden and rearranged however you like.
203 `git cola` carefully remembers your window layout and restores
204 it the next time it is launched.
206 The `Control-{1, 2, 3, ...}` hotkey gives focus to a specific tool.
207 A hidden tool can be re-opened using the `Tools` menu or
208 the `Shift+Control-{1, 2, 3, ...}` shortcut keys.
210 The Diff editor can be focused with `Ctrl-j`.
211 the Status tool can be focused with `Ctrl-k`.
212 the Commit tool can be focused with `Ctrl-l`.
215 .. _status:
217 STATUS
218 ======
219 The `Status` tool provides a visual analog to the
220 `git status <http://git-scm.com/docs/git-status>`_ command.
222 `Status` displays files that are `modified` relative to the staging area,
223 `staged` for the next commit, `unmerged` files from an in-progress merge,
224 and files that are `untracked` to git.
226 These are the same categories one sees when running
227 `git status <http://git-scm.com/docs/git-status>`_
228 on the command line.
230 You can navigate through the list of files using keyboard arrows as well
231 as the ergonomical and vim-like `j` and `k` shortcut keys.
233 There are several convenient ways to interact with files in the `Status` tool.
235 Selecting a file displays its diff in the `Diff` viewer.
236 Double-clicking a file stages its contents, as does the
237 the `Ctrl-s` shortcut key.
239 `Ctrl-e` opens selected files in the configured editor, and
240 `Ctrl-d` opens selected files using `git difftool <http://git-scm.com/docs/git-difftool>`_
242 Additional actions can be performed using the right-click context menu.
244 Drag and Drop
245 -------------
246 Files can be dragged from the the `Status` tool onto other applications.
248 Some terminals will treat a drag with multiple files by separating them with newlines,
249 which is less amenable for pasting command-line arguments.
251 To avoid this issue, hold down `Alt / Option` when dragging from the `Status` tool.
252 The drag and drop payload will no longer contain local file URLs -- it will contain
253 plain text that is amenable for use on a command-line.
255 Note: if drag and drop is not working and you are on Wayland then you may
256 need to ``export QT_QPA_PLATFORM=wayland`` in your environment.
258 Actions
259 -------
260 Clicking the `Staged` folder shows a diffstat for the index.
262 Clicking the `Modified` folder shows a diffstat for the worktree.
264 Clicking individual files sends diffs to the `Diff Display`.
266 Double-clicking individual files adds and removes their content from the index.
268 Various actions are available through the right-click context menu.
269 Different actions are available depending a file's status.
271 Stage Selected
272 ~~~~~~~~~~~~~~
273 Add to the staging area using `git add <http://git-scm.com/docs/git-add>`_
274 Marks unmerged files as resolved.
276 Launch Editor
277 ~~~~~~~~~~~~~
278 Launches the configured visual text editor
280 Launch Difftool
281 ~~~~~~~~~~~~~~~
282 Visualize changes using `git difftool`.
284 Revert Unstaged Edits
285 ~~~~~~~~~~~~~~~~~~~~~
286 Reverts unstaged content by checking out selected paths
287 from the index/staging area
289 Revert Uncommitted Edits
290 ~~~~~~~~~~~~~~~~~~~~~~~~
291 Throws away uncommitted edits
293 Unstage Selected
294 ~~~~~~~~~~~~~~~~
295 Remove from the index/staging area with
296 `git reset <http://git-scm.com/docs/git-reset>`_
298 Launch Merge Tool
299 ~~~~~~~~~~~~~~~~~
300 Resolve conflicts using `git mergetool <http://git-scm.com/docs/git-mergetool>`_.
302 Delete File(s)
303 ~~~~~~~~~~~~~~
304 Delete untracked files from the filesystem.
306 Add to .gitignore
307 ~~~~~~~~~~~~~~~~~
308 Adds untracked files to to the .gitignore file.
311 .. _diff:
313 DIFF
314 ====
315 The diff viewer/editor displays diffs for selected files.
316 Additions are shown in green and removals are displayed in light red.
317 Extraneous whitespace is shown with a pure-red background.
319 Right-clicking in the diff provides access to additional actions
320 that use either the cursor location or text selection.
322 The "Copy Diff" action at ``Alt + Shift + C`` copies the selected lines to the
323 clipboard. The ``+``, ``-`` and `` `` diff line prefixes are stripped from each line
324 when copying diffs using the "Copy Diff" action.
326 Staging content for commit
327 --------------------------
328 The ``@@`` patterns denote a new diff hunk.  Selecting lines of diff
329 and using the `Stage Selected Lines` command will stage just the selected
330 lines.  Clicking within a diff hunk and selecting `Stage Diff Hunk` stages the
331 entire patch diff hunk.
333 The corresponding opposite commands can be performed on staged files as well,
334 e.g. staged content can be selectively removed from the index when we are
335 viewing diffs for staged content.
337 Diff Against Commit (Diff Mode)
338 -------------------------------
339 *Diff Mode* allows you to selectively unstage and revert edits from arbitrary commits
340 so that you can bring these edits back into your worktree.
342 You can use the diff editor to unstage edits against arbitrary commits by using the
343 ``Diff > Against Commit... (Diff Mode)`` menu action.
345 You can exit *Diff Mode* by clicking on the red circle-slash icon on the Status
346 widget, by using the ``Diff > Exit Diff mode`` menu action, or by clicking in
347 an empty area in the `Status` tool.
350 COMMIT MESSAGE EDITOR
351 =====================
353 The commit message editor is a simple text widget
354 for entering commit messages.
356 You can navigate between the `Subject` and `Extended description...`
357 fields using the keyboard arrow keys.
359 Pressing enter when inside the `Subject` field jumps down to the
360 extended description field.
362 The `Options` button menu to the left of the subject field
363 provides access to the additional actions.
365 The `Ctrl+i` keyboard shortcut adds a standard "Signed-off-by: " line,
366 and `Ctrl+Enter` creates a new commit using the commit message and
367 staged content.
369 Sign Off
370 --------
371 The `Sign Off` button adds a standard::
373     Signed-off-by: A. U. Thor <a.u.thor@example.com>
375 line to the bottom of the commit message.
377 Invoking this action is equivalent to passing the ``-s`` option
378 to `git commit <http://git-scm.com/docs/git-commit>`_.
380 Commit
381 ------
382 The commit button runs
383 `git commit <http://git-scm.com/docs/git-commit>`_.
384 The contents of the commit message editor is provided as the commit message.
386 Only staged files are included in the commit -- this is the same behavior
387 as running ``git commit`` on the command-line.
389 Line and Column Display
390 -----------------------
391 The current line and column number is displayed by the editor.
392 E.g. a ``5,0`` display means that the cursor is located at
393 line five, column zero.
395 The display changes colors when lines get too long.
396 Yellow indicates the safe boundary for sending patches to a mailing list
397 while keeping space for inline reply markers.
399 Orange indicates that the line is starting to run a bit long and should
400 break soon.
402 Red indicates that the line is running up against the standard
403 80-column limit for commit messages.
405 Keeping commit messages less than 76-characters wide is encouraged.
406 `git log <http://git-scm.com/docs/git-log>`_
407 is a great tool but long lines mess up its formatting for everyone else,
408 so please be mindful when writing commit messages.
411 Amend Last Commit
412 -----------------
413 Clicking on `Amend Last Commit` makes `git cola` amend the previous commit
414 instead of creating a new one.  `git cola` loads the previous commit message
415 into the commit message editor when this option is selected.
417 The `Status` tool will display all of the changes for the amended commit.
419 Create Signed Commit
420 --------------------
421 Tell `git commit` and `git merge` to sign commits using GPG.
423 Using this option is equivalent to passing the ``--gpg-sign`` option to
424 `git commit <http://git-scm.com/docs/git-commit>`_ and
425 `git merge <http://git-scm.com/docs/git-merge>`_.
427 This option's default value can be configured using the `cola.signcommits`
428 configuration variable.
430 Prepare Commit Message
431 ----------------------
432 The ``Commit -> Prepare Commit Message`` action or `Ctrl-Shift-Return` keyboard shortcut
433 runs the `cola-prepare-commit-msg` hook if it is available in `.git/hooks/`.
434 This is a `git cola`-specific hook that takes the same parameters
435 as Git's `prepare-commit-msg hook <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_
437 The hook is passed the path to `.git/GIT_COLA_MSG` as the first argument and the hook is expected to write
438 an updated commit message to specified path.  After running this action, the
439 commit message editor is updated with the new commit message.
441 To override the default path to this hook set the
442 `cola.prepareCommitMessageHook` `git config` variable to the path to the
443 hook script.  This is useful if you would like to use a common hook
444 across all repositories.
446 BRANCHES
447 ========
449 The `Branches` tool provides a visual tree to navigate through the branches.
450 The tree has three main nodes `Local Branch`, `Remote Branch` and `Tags`.
451 Branches are grouped by their name divided by the character '/'.Ex::
453     branch/feature/foo
454     branch/feature/bar
455     branch/doe
457 Will produce::
459     branch
460         - doe
461         + feature
462             - bar
463             - foo
465 Current branch will display a star icon. If current branch has commits
466 ahead/behind it will display an up/down arrow with its number.
468 Actions
469 -------
470 Various actions are available through the right-click context menu.
471 Different actions are available depending of selected branch status.
473 Checkout
474 ~~~~~~~~
475 The checkout action runs
476 `git checkout [<branchname>] <https://git-scm.com/docs/git-checkout>`_.
478 Merge in current branch
479 ~~~~~~~~~~~~~~~~~~~~~~~
480 The merge action runs
481 `git merge --no-commit [<branchname>] <https://git-scm.com/docs/git-merge>`_.
483 Pull
484 ~~~~
485 The pull action runs
486 `git pull --no-ff [<remote>] [<branchname>] <https://git-scm.com/docs/git-pull>`_.
488 Push
489 ~~~~
490 The push action runs
491 `git push [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
493 Rename Branch
494 ~~~~~~~~~~~~~
495 The rename branch action runs
496 `git branch -M [<branchname>] <https://git-scm.com/docs/git-push>`_.
498 Delete Branch
499 ~~~~~~~~~~~~~
500 The delete branch branch action runs
501 `git branch -D [<branchname>] <https://git-scm.com/docs/git-branch>`_.
503 Delete Remote Branch
504 ~~~~~~~~~~~~~~~~~~~~
505 The remote branch action runs
506 `git push --delete [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
509 APPLY PATCHES
510 =============
511 Use the ``File -> Apply Patches`` menu item to begin applying patches.
513 Dragging and dropping patches onto the `git cola` interface
514 adds the patches to the list of patches to apply using
515 `git am <http://git-scm.com/docs/git-am>`_.
517 You can drag either a set of patches or a directory containing patches.
518 Patches can be sorted using in the interface and are applied in the
519 same order as is listed in the list.
521 When a directory is dropped `git cola` walks the directory
522 tree in search of patches.  `git cola` sorts the list of
523 patches after they have all been found.  This allows you
524 to control the order in which patches are applied by placing
525 patchsets into alphanumerically-sorted directories.
527 CUSTOM WINDOW SETTINGS
528 ======================
529 `git cola` remembers modifications to the layout and arrangement
530 of tools within the `git cola` interface.  Changes are saved
531 and restored at application shutdown/startup.
533 `git cola` can be configured to not save custom layouts by unsetting
534 the `Save Window Settings` option in the `git cola` preferences.
536 DARK MODE AND WINDOW MANAGER THEMES
537 ===================================
538 Git Cola contains a ``default`` theme which follows the current Qt style and a
539 handful of built-in color themes.  See :ref:`cola_theme` for more details.
541 To use icons appropriate for a dark application theme, configure
542 ``git config --global cola.icontheme dark`` to use the dark icon theme.
543 See :ref:`cola_icontheme` for more details.
545 On macOS, using the ``default`` theme will automatically inherit "Dark Mode"
546 color themes when configured via System Preferences.  You will need to
547 configure the dark icon theme as noted above when dark mode is enabled.
549 On Linux, you may want Qt to follow the Window manager theme by configuring it
550 to do so using the ``qt5ct`` Qt5 configuration tool.  Install ``qt5ct`` on
551 Debian/Ubuntu systems to make this work.::
553     sudo apt install qt5ct
555 Once installed, update your `~/.bash_profile` to activate ``qt5ct``::
557     # Use the style configured using the qt5ct tool
558     export QT_QPA_PLATFORMTHEME=qt5ct
560 This only work with the `default` theme.  The other themes replace the color
561 palette with theme-specific colors.
563 Some systems may require that you override `QT_STYLE_OVERRIDE` in order to
564 use a dark theme or to better interact with the Desktop environment.
565 Some systems provide a theme that you can install::
567     sudo apt-get install adwaita-qt
569 You can activate the theme using the following environment variable::
571     # Override the default theme to adwaita-dark
572     export QT_STYLE_OVERRIDE=adwaita-dark
574 `QT_STYLE_OVERRIDE` may already be set in your Desktop Environment, so check that
575 variable for reference if you get unexpected hangs when launching `git-cola` or
576 when the default theme does not follow the desktop's theme on Linux.
578 If you don't want to set this variable globally then you can set it when launching
579 cola from the command-line::
581     QT_STYLE_OVERRIDE=adwaita-dark git cola
583 The following is a user-contributed custom `git-cola.desktop` file that can be used to
584 launch Git Cola with these settings preset for you::
586     [Desktop Entry]
587     Name=Git Cola (dark)
588     Comment=The highly caffeinated Git GUI
589     TryExec=git-cola
590     Exec=env QT_STYLE_OVERRIDE=adwaita-dark git-cola --prompt --icon-theme dark
591     Icon=git-cola
592     StartupNotify=true
593     Terminal=false
594     Type=Application
595     Categories=Development;RevisionControl;
596     X-KDE-SubstituteUID=false
598 You may also want to customize the diff colors when using a dark theme::
600     git config --global cola.color.add 86c19f
601     git config --global cola.color.remove c07067
603 Please see `#760 <https://github.com/git-cola/git-cola/issues/760>`_ for more details.
605 Custom Themes
606 -------------
607 To create your own custom theme for Git Cola just create a QSS file and put it in
608 ``~/.config/themes/``. You can add as many files as you want. Each file will become
609 an option in ``Menu -> File -> Preferences -> Appearance -> GUI theme``.
611 Some examples can be found here `Qt Style Sheets Examples <https://doc.qt.io/qt-5/stylesheet-examples.html>`_.
614 CONFIGURATION VARIABLES
615 =======================
616 These variables can be set using `git config` or from the settings.
618 cola.autocompletepaths
619 ----------------------
620 Set to `false` to disable auto-completion of filenames in completion widgets.
621 This can speed up operations when working in large repositories.
622 Defaults to `true`.
624 cola.autoloadCommitTemplate
625 ---------------------------
626 Set to `true` to automatically load the commit template in the commit message
627 editor If the commit.template variable has not been configured, raise the
628 corresponding error.
629 Defaults to `false`.
631 cola.blameviewer
632 ----------------
633 The command used to blame files.  Defaults to `git gui blame`.
635 cola.blockcursor
636 ----------------
637 Whether to use a "block" cursor in diff editors. The block cursor is easier to
638 see compared to a line cursor. Set to `false` to use a thin "line" cursor.
639 Defauls to `true`.
641 cola.browserdockable
642 --------------------
643 Whether to create a dock widget with the `Browser` tool.
644 Defaults to `false` to speedup startup time.
646 cola.checkconflicts
647 -------------------
648 Inspect unmerged files for conflict markers before staging them.
649 This feature helps prevent accidental staging of unresolved merge conflicts.
650 Defaults to `true`.
652 cola.defaultrepo
653 ----------------
654 `git cola`, when run outside of a Git repository, prompts the user for a
655 repository.  Set `cola.defaultrepo` to the path of a Git repository to make
656 `git cola` attempt to use that repository before falling back to prompting
657 the user for a repository.
659 cola.dictionary
660 ---------------
661 Specifies an additional dictionary for `git cola` to use in its spell checker.
662 This should be configured to the path of a newline-separated list of words.
664 By default, `git cola` searches for `dict/words` and `dict/propernames` dictionary
665 files in `~/.local/share` and `$XDG_DATA_DIRS`.
667 If `$XDG_DATA_DIRS` is undefined or set to an empty value then `/usr/local/share` and
668 `/usr/share` are searched for dictionary files.
670 Dictionary files are newline-separated and contain one word per line.
672 cola.expandtab
673 --------------
674 Expand tabs into spaces in the commit message editor.  When set to `true`,
675 `git cola` will insert a configurable number of spaces when tab is pressed.
676 The number of spaces is determined by `cola.tabwidth`.
677 Defaults to `false`.
679 cola.gravatar
680 -------------
681 Use the `gravatar.com` service to lookup icons for author emails.
682 Gravatar icons work by sending an MD5 hash of an author's email to `gravatar.com`
683 when requesting an icon. Warning: this feature can leak information.
684 Network requests to `gravatar.com` are disabled when set to `false`.
685 Defaults to `true`.
687 cola.fileattributes
688 -------------------
689 Enables per-file gitattributes encoding and binary file support.
690 This tells `git cola` to honor the configured encoding when displaying
691 and applying diffs.
693 A `.gitattributes` file can set the ``binary`` attribute in order to force
694 specific untracked paths to be treated as binary files when diffing.
695 Binary files are displayed using a hexdump display.
697 .. sourcecode:: sh
699    # Treat *.exr files as binary files.
700    *.exr binary
702 cola.fontdiff
703 -------------
704 Specifies the font to use for `git cola`'s diff display.
706 cola.hidpi
707 ----------
708 Specifies the High DPI displays scale factor. Set `0` to automatically scaled.
709 Setting value between 0 and 1 is undefined.
710 This option requires at least Qt 5.6 to work.
711 See `Qt QT_SCALE_FACTOR documentation <https://doc.qt.io/qt-5/highdpi.html>`_
712 for more information.
714 .. _cola_icontheme:
716 cola.icontheme
717 --------------
718 Specifies the icon themes to use throughout `git cola`. The theme specified
719 must be the name of the subdirectory containing the icons, which in turn must
720 be placed in the inside the main "icons" directory in `git cola`'s
721 installation prefix.
723 If unset, or set either "light" or "default", then the default style will be
724 used.  If set to "dark" then the built-in "dark" icon theme, which is
725 suitable for a dark window manager theme, will be used.
727 If set to an absolute directory path then icons in that directory will be used.
728 This value can be set to multiple values using,
729 ``git config --add cola.icontheme $theme``.
731 This setting can be overridden by the `GIT_COLA_ICON_THEME` environment
732 variable, which can specify multiple themes using a colon-separated value.
734 The icon theme can also be specified by passing ``--icon-theme=<theme>`` on the
735 command line, once for each icon theme, in the order that they should be
736 searched.  This can be used to override a subset of the icons, and fallback
737 to the built-in icons for the remainder.
739 cola.imagediff.[extension]
740 --------------------------
741 Enable image diffs for the specified file extension.  For example, configuring
742 `git config --global cola.imagediff.svg false` will disable use of the visual
743 image diff for `.svg` files in all repos until is is explicitly toggled on.
744 Defaults to `true`.
746 cola.inotify
747 ------------
748 Set to `false` to disable file system change monitoring.  Defaults to `true`,
749 but also requires either Linux with inotify support or Windows with `pywin32`
750 installed for file system change monitoring to actually function.
752 cola.refreshonfocus
753 -------------------
754 Set to `true` to automatically refresh when `git cola` gains focus.  Defaults
755 to `false` because this can cause a pause whenever switching to `git cola` from
756 another application.
758 cola.linebreak
759 --------------
760 Whether to automatically break long lines while editing commit messages.
761 Defaults to `true`.  This setting is configured using the `Preferences`
762 dialog, but it can be toggled for one-off usage using the commit message
763 editor's options sub-menu.
765 cola.maxrecent
766 --------------
767 `git cola` caps the number of recent repositories to avoid cluttering
768 the start and recent repositories menu.  The maximum number of repositories to
769 remember is controlled by `cola.maxrecent` and defaults to `8`.
771 cola.mousezoom
772 --------------
773 Controls whether zooming text using Ctrl + MouseWheel scroll is enabled.
774 Set to `false to disable scrolling with the mouse wheel.
775 Defauls to `true`.
777 cola.dragencoding
778 -----------------
779 `git cola` encodes paths dragged from its widgets into `utf-16` when adding
780 them to the drag-and-drop mime data (specifically, the `text/x-moz-url` entry).
781 `utf-16` is used to make `gnome-terminal` see the right paths, but other
782 terminals may expect a different encoding.  If you are using a terminal that
783 expects a modern encoding, e.g. `terminator`, then set this value to `utf-8`.
785 cola.readsize
786 -------------
787 `git cola` avoids reading large binary untracked files.
788 The maximum size to read is controlled by `cola.readsize`
789 and defaults to `2048`.
791 cola.resizebrowsercolumns
792 -------------------------
793 `git cola` will automatically resize the file browser columns as folders are
794 expanded/collapsed when ``cola.resizebrowsercolumns`` is set to `true`.
796 cola.safemode
797 -------------
798 The "Stage" button in the `git cola` Actions panel stages all files when it is
799 activated and no files are selected.  This can be problematic if it is
800 accidentally triggered after carefully preparing the index with staged
801 changes.  "Safe Mode" is enabled by setting `cola.safemode` to `true`.
802 When enabled, `git cola` will do nothing when "Stage" is activated without a
803 selection.  Defaults to `false`.
805 cola.savewindowsettings
806 -----------------------
807 `git cola` will remember its window settings when set to `true`.
808 Window settings and X11 sessions are saved in `$HOME/.config/git-cola`.
810 cola.showpath
811 -------------
812 `git cola` displays the absolute path of the repository in the window title.
813 This can be disabled by setting `cola.showpath` to `false`.
814 Defaults to `true`.
816 cola.signcommits
817 ----------------
818 `git cola` will sign commits by default when set `true`. Defaults to `false`.
819 See the section below on setting up GPG for more details.
821 cola.startupmode
822 ----------------
823 Control how the list of repositories is displayed in the startup dialog.
824 Set to `list` to view the list of repositories as a list, or `folder` to view
825 the list of repositories as a collection of folder icons.
826 Defaults to `list`.
828 cola.statusindent
829 -----------------
830 Set to `true` to indent files in the Status widget.  Files in the `Staged`,
831 `Modified`, etc. categories will be grouped in a tree-like structure.
832 Defaults to `false`.
834 cola.statusshowtotals
835 ---------------------
836 Set to `true` to display files counts in the Status widget's category titles.
837 Defaults to `false`.
839 cola.tabwidth
840 -------------
841 The number of columns occupied by a tab character.  Defaults to 8.
843 cola.terminal
844 -------------
845 The command to use when launching commands within a graphical terminal.
847 `cola.terminal` defaults to `xterm -e` when unset.
848 e.g. when opening a shell, `git cola` will run `xterm -e $SHELL`.
850 `git cola` has built-in support for `xterm`, `gnome-terminal`, `konsole`.
851 If either `gnome-terminal`, `xfce4-terminal`, or `konsole` are installed
852 then they will be preferred over `xterm` when `cola.terminal` is unset.
854 The table below shows the built-in values that are used for the respective
855 terminal.  You can force the use of a specific terminal by configuring cola
856 accordingly.
858 cola.terminalshellquote
859 -----------------------
860 Some terminal require that the command string get passed as a string.
861 For example, ``xfce4-terminal -e "git difftool"`` requires shell quoting,
862 whereas ``gnome-terminal -- git difftool`` does not.
864 You should not need to set this variable for the built-in terminals
865 cola knows about -- it will behave correctly without configuration.
866 For example, when unconfigured, cola already knows that xfce4-terminal
867 requires shell quoting.
869 This configuration variable is for custom terminals outside of the builtin set.
870 The table below shows the builtin configuration.
872 =================== ======================= =============================
873 Terminal            ``cola.terminal``       ``cola.terminalshellquote``
874 =================== ======================= =============================
875 gnome-terminal      ``gnome-terminal --``   ``false``
876 konsole             ``konsole -e``          ``false``
877 xfce4-terminal      ``xfce4-terminal -e``   ``true``
878 xterm               ``xterm -e``            ``false``
879 =================== ======================= =============================
881 cola.textwidth
882 --------------
883 The number of columns used for line wrapping.
884 Tabs are counted according to `cola.tabwidth`.
886 .. _cola_theme:
888 cola.theme
889 ----------
890 Specifies the GUI theme to use throughout `git cola`. The theme specified
891 must be one of the following values:
893 * `default` â€“ default Qt theme, may appear different on various systems
894 * `flat-dark-blue`
895 * `flat-dark-green`
896 * `flat-dark-grey`
897 * `flat-dark-red`
898 * `flat-light-blue`
899 * `flat-light-green`
900 * `flat-light-grey`
901 * `flat-light-red`
903 If unset, or set to an invalid value, then the default style will be
904 used. The `default` theme is generated by Qt internal engine and should look
905 native but may look noticeably different on different platforms. The flat
906 themes on the other hand should look similar (but not identical) on various
907 systems.
909 The GUI theme can also be specified by passing ``--theme=<name>`` on the
910 command line.
912 cola.turbo
913 ----------
914 Set to `true` to enable "turbo" mode.  "Turbo" mode disables some
915 features that can slow things down when operating on huge repositories.
916 "Turbo" mode will skip loading Git commit messages, author details, status
917 information, and commit date details in the `File Browser` tool.
918 Defaults to `false`.
920 cola.color.text
921 ---------------
922 The default diff text color, in hexadecimal #RRGGBB notation.
923 Defaults to "#030303"::
925     git config cola.color.text '#030303'
927 cola.color.add
928 --------------
929 The default diff "add" background color, in hexadecimal #RRGGBB notation.
930 Defaults to "#d2ffe4"::
932     git config cola.color.add '#d2ffe4'
934 cola.color.remove
935 -----------------
936 The default diff "remove" background color, in hexadecimal #RRGGBB notation.
937 Defaults to "#fee0e4"::
939     git config cola.color.remove '#fee0e4'
941 cola.color.header
942 -----------------
943 The default diff header text color, in hexadecimal #RRGGBB notation.
944 Defaults to "#bbbbbb"::
946     git config cola.color.header '#bbbbbb'
948 core.hooksPath
949 --------------
950 Hooks are programs you can place in a hooks directory to trigger actions at
951 certain points in git’s execution. Hooks that don’t have the executable bit
952 set are ignored.
954 By default the hooks directory is ``$GIT_DIR/hooks``, but that can
955 be changed via the ``core.hooksPath`` configuration variable
957 The ``cola-prepare-commit-msg`` hook functionality and Cola's Git LFS
958 detection honors this configuration.
960 Please see the `git hooks documentation <https://git-scm.com/docs/githooks>`_
961 for more details.
963 gui.diffcontext
964 ---------------
965 The number of diff context lines to display.
967 gui.displayuntracked
968 --------------------
969 `git cola` avoids showing untracked files when set to `false`.
971 gui.editor
972 ----------
973 The default text editor to use is defined in `gui.editor`.
974 The config variable overrides the VISUAL environment variable.
975 e.g. `gvim -f -p`.
977 gui.historybrowser
978 ------------------
979 The history browser to use when visualizing history.
980 Defaults to `gitk`.
982 diff.tool
983 ---------
984 The default diff tool to use.
986 merge.tool
987 ----------
988 The default merge tool to use.
990 user.email
991 ----------
992 Your email address to be recorded in any newly created commits.
993 Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
994 'EMAIL' environment variables.
996 user.name
997 ---------
998 Your full name to be recorded in any newly created commits.
999 Can be overridden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'
1000 environment variables.
1002 ENVIRONMENT VARIABLES
1003 =====================
1005 GIT_COLA_ICON_THEME
1006 -------------------
1007 When set in the environment, `GIT_COLA_ICON_THEME` overrides the
1008 theme specified in the `cola.icontheme` configuration.
1009 Read :ref:`cola_icontheme` for more details.
1011 GIT_COLA_SCALE
1012 --------------
1013 .. Important:: `GIT_COLA_SCALE` should not be used with newer versions of Qt.
1015     Set `QT_AUTO_SCREEN_SCALE_FACTOR` to `1` and Qt will automatically
1016     scale the interface to the correct size based on the display DPI.
1017     This option is also available by setting `cola.hidpi` configuration.
1019     See the `Qt High DPI documentation <https://doc.qt.io/qt-5/highdpi.html>`_
1020     for more details.
1022 `git cola` can be made to scale its interface for HiDPI displays.
1023 When defined, `git cola` will scale icons, radioboxes, and checkboxes
1024 according to the scale factor.  The default value is `1`.
1025 A good value is `2` for high-resolution displays.
1027 Fonts are not scaled, as their size can already be set in the settings.
1029 GIT_COLA_TRACE
1030 --------------
1031 When defined, `git cola` logs `git` commands to stdout.
1032 When set to `full`, `git cola` also logs the exit status and output.
1033 When set to `trace`, `git cola` logs to the `Console` widget.
1035 VISUAL
1036 ------
1037 Specifies the default editor to use.
1038 This is ignored when the `gui.editor` configuration variable is defined.
1040 LANGUAGE SETTINGS
1041 =================
1042 `git cola` automatically detects your language and presents some
1043 translations when available.  This may not be desired, or you
1044 may want `git cola` to use a specific language.
1046 You can make `git cola` use an alternative language by creating a
1047 `~/.config/git-cola/language` file containing the standard two-letter
1048 gettext language code, e.g. "en", "de", "ja", "zh", etc.::
1050     mkdir -p ~/.config/git-cola &&
1051     echo en >~/.config/git-cola/language
1053 Alternatively you may also use LANGUAGE environmental variable to temporarily
1054 change `git cola`'s language just like any other gettext-based program.  For
1055 example to temporarily change `git cola`'s language to English::
1057     LANGUAGE=en git cola
1059 To make `git cola` use the zh_TW translation with zh_HK, zh, and en as a
1060 fallback.::
1062     LANGUAGE=zh_TW:zh_HK:zh:en git cola
1065 CUSTOM GUI ACTIONS
1066 ==================
1067 `git cola` allows you to define custom GUI actions by setting `git config`
1068 variables.  The "name" of the command appears in the "Actions" menu.
1070 guitool.<name>.cmd
1071 ------------------
1072 Specifies the shell command line to execute when the corresponding item of the
1073 Tools menu is invoked. This option is mandatory for every tool. The command is
1074 executed from the root of the working directory, and in the environment it
1075 receives the name of the tool as GIT_GUITOOL, the name of the currently
1076 selected file as FILENAME, and the name of the current branch as CUR_BRANCH
1077 (if the head is detached, CUR_BRANCH is empty).
1079 If ``<name>`` contains slashes (``/``) then the leading part of the name,
1080 up until the final slash, is treated like a path of submenus under which the
1081 actions will be created.
1083 For example, configuring ``guitool.Commands/Util/echo.cmd`` creates a
1084 ``Commands`` menu inside the top-level ``Actions`` menu, a ``Util`` menu
1085 inside the ``Commands`` menu and an ``echo`` action inside the ``Commands``
1086 submenu.
1088 guitool.<name>.background
1089 -------------------------
1090 Run the command in the background (similar to editing and difftool actions).
1091 This avoids blocking the GUI.  Setting `background` to `true` implies
1092 `noconsole` and `norescan`.
1094 guitool.<name>.needsfile
1095 ------------------------
1096 Run the tool only if a diff is selected in the GUI. It guarantees that
1097 FILENAME is not empty.
1099 guitool.<name>.noconsole
1100 ------------------------
1101 Run the command silently, without creating a window to display its output.
1103 guitool.<name>.norescan
1104 -----------------------
1105 Don’t rescan the working directory for changes after the tool finishes
1106 execution.
1108 guitool.<name>.confirm
1109 ----------------------
1110 Show a confirmation dialog before actually running the tool.
1112 guitool.<name>.argprompt
1113 ------------------------
1114 Request a string argument from the user, and pass it to the tool through the
1115 ARGS environment variable. Since requesting an argument implies confirmation,
1116 the confirm option has no effect if this is enabled. If the option is set to
1117 true, yes, or 1, the dialog uses a built-in generic prompt; otherwise the
1118 exact value of the variable is used.
1120 guitool.<name>.revprompt
1121 ------------------------
1122 Request a single valid revision from the user, and set the REVISION
1123 environment variable. In other aspects this option is similar to argprompt,
1124 and can be used together with it.
1126 guitool.<name>.revunmerged
1127 --------------------------
1128 Show only unmerged branches in the revprompt subdialog. This is useful for
1129 tools similar to merge or rebase, but not for things like checkout or reset.
1131 guitool.<name>.title
1132 --------------------
1133 Specifies the title to use for the prompt dialog.
1134 Defaults to the tool name.
1136 guitool.<name>.prompt
1137 ---------------------
1138 Specifies the general prompt string to display at the top of the dialog,
1139 before subsections for argprompt and revprompt.
1140 The default value includes the actual command.
1142 guitool.<name>.shortcut
1143 -----------------------
1144 Specifies a keyboard shortcut for the custom tool.
1146 The value must be a valid string understood by the `QAction::setShortcut()` API.
1147 See http://qt-project.org/doc/qt-4.8/qkeysequence.html#QKeySequence-2
1148 for more details about the supported values.
1150 Avoid creating shortcuts that conflict with existing built-in `git cola`
1151 shortcuts.  Creating a conflict will result in no action when the shortcut
1152 is used.
1154 SETTING UP GPG FOR SIGNED COMMITS
1155 =================================
1156 When creating signed commits, `gpg` will attempt to read your password from the
1157 terminal from which `git cola` was launched.
1158 The way to make this work smoothly is to use a GPG agent so that you can avoid
1159 needing to re-enter your password every time you commit.
1161 This also gets you a graphical passphrase prompt instead of getting prompted
1162 for your password in the terminal.
1164 Install gpg-agent and friends
1165 -----------------------------
1166 On Mac OS X, you may need to `brew install gpg-agent` and install the
1167 `Mac GPG Suite <https://gpgtools.org/macgpg2/>`_.
1169 On Linux use your package manager to install gnupg2,
1170 gnupg-agent and pinentry-qt, e.g.::
1172     sudo apt-get install gnupg2 gnupg-agent pinentry-qt
1174 On Linux, you should also configure Git so that it uses gpg2 (gnupg2),
1175 otherwise you will get errors mentioning, "unable to open /dev/tty".
1176 Set Git's `gpg.program` to `gpg2`::
1178     git config --global gpg.program gpg2
1180 Configure gpg-agent and a pin-entry program
1181 -------------------------------------------
1182 On Mac OS X, edit `~/.gnupg/gpg.conf` to include the line,::
1184     use-agent
1186 This is typically not needed on Linux, where `gpg2` is used, as
1187 this is the default value when using `gpg2`.
1189 Next, edit `~/.gnupg/gpg-agent.conf` to contain a pinentry-program line
1190 pointing to the pinentry program for your platform.
1192 The following example `~/.gnupg/gpg-agent.conf` shows how to use
1193 pinentry-gtk-2 on Linux::
1195     pinentry-program /usr/bin/pinentry-gtk-2
1196     default-cache-ttl 3600
1198 This following example `.gnupg/gpg-agent.conf` shows how to use MacGPG2's
1199 pinentry app on On Mac OS X::
1201     pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
1202     default-cache-ttl 3600
1203     enable-ssh-support
1204     use-standard-socket
1206 Once this has been set up then you will need to reload your gpg-agent config::
1208     echo RELOADAGENT | gpg-connect-agent
1210 If you see the following output::
1212     OK
1214 Then the daemon is already running, and you do not need to start it yourself.
1216 If it is not running, eval the output of ``gpg-agent --daemon`` in your shell
1217 prior to launching `git cola`.::
1219     eval $(gpg-agent --daemon)
1220     git cola
1222 WINDOWS NOTES
1223 =============
1225 Git Installation
1226 ----------------
1227 If Git is installed in a custom location, e.g. not installed in `C:/Git` or
1228 Program Files, then the path to Git must be configured by creating a file in
1229 your home directory `~/.config/git-cola/git-bindir` that points to your git
1230 installation.  e.g.::
1232     C:/Tools/Git/bin
1234 SSH Agents for Key-based Authentication
1235 ---------------------------------------
1236 You may need to setup ssh-agent in order to use SSH key-based authentication
1237 on Windows. It has been reported that starting OpenSSH agent in
1238 Windows Services and adding the key using Powershell are necessary in order
1239 to get things working.
1241 Please see the following links for more details.
1243 https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows
1245 FIPS Security Mode
1246 ==================
1247 `FIPS Security Mode <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation>`_
1248 is available in newer versions of Python. These include Python 3.9+ and the
1249 patched Python 3.6 used by CentOS8/RHEL8 (and possibly others).
1251 Git Cola uses the ``hashlib.md5`` function and adheres to the FIPS security
1252 mode when available. Git Cola does not use the MD5 value for security purposes.
1253 MD5 is used only for the purposes of implementing the ``cola/gravatar.py``
1254 Gravatar client.
1256 LINKS
1257 =====
1259 Git Cola's Git Repository
1260 -------------------------
1261 https://github.com/git-cola/git-cola/
1263 Git Cola Homepage
1264 -----------------
1265 https://git-cola.github.io/
1267 Mailing List
1268 ------------
1269 https://groups.google.com/group/git-cola