diff: use a block cursor for better usability
[git-cola.git] / docs / git-cola.rst
blobd10901c8e7222ddf195fbcdadbfb8ec8ade5dc47
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`.
214 .. _status:
216 STATUS
217 ======
218 The `Status` tool provides a visual analog to the
219 `git status <http://git-scm.com/docs/git-status>`_ command.
221 `Status` displays files that are `modified` relative to the staging area,
222 `staged` for the next commit, `unmerged` files from an in-progress merge,
223 and files that are `untracked` to git.
225 These are the same categories one sees when running
226 `git status <http://git-scm.com/docs/git-status>`_
227 on the command line.
229 You can navigate through the list of files using keyboard arrows as well
230 as the ergonomical and vim-like `j` and `k` shortcut keys.
232 There are several convenient ways to interact with files in the `Status` tool.
234 Selecting a file displays its diff in the `Diff` viewer.
235 Double-clicking a file stages its contents, as does the
236 the `Ctrl-s` shortcut key.
238 `Ctrl-e` opens selected files in the configured editor, and
239 `Ctrl-d` opens selected files using `git difftool <http://git-scm.com/docs/git-difftool>`_
241 Additional actions can be performed using the right-click context menu.
243 Drag and Drop
244 -------------
245 Files can be dragged from the the `Status` tool onto other applications.
247 Some terminals will treat a drag with multiple files by separating them with newlines,
248 which is less amenable for pasting command-line arguments.
250 To avoid this issue, hold down `Alt / Option` when dragging from the `Status` tool.
251 The drag and drop payload will no longer contain local file URLs -- it will contain
252 plain text that is amenable for use on a command-line.
254 Note: if drag and drop is not working and you are using Wayland / Gnome then you may
255 need to check whether you have ``QT_QPA_PLATFORM`` set in your environment to a value
256 other than ``wayland``. Git Cola will set this value to ``wayland`` when Wayland is
257 detected, but this setup is not performed if the ``QT_QPA_PLATFORM`` environment
258 variable is already set.
260 Actions
261 -------
262 Clicking the `Staged` folder shows a diffstat for the index.
264 Clicking the `Modified` folder shows a diffstat for the worktree.
266 Clicking individual files sends diffs to the `Diff Display`.
268 Double-clicking individual files adds and removes their content from the index.
270 Various actions are available through the right-click context menu.
271 Different actions are available depending a file's status.
273 Stage Selected
274 ~~~~~~~~~~~~~~
275 Add to the staging area using `git add <http://git-scm.com/docs/git-add>`_
276 Marks unmerged files as resolved.
278 Launch Editor
279 ~~~~~~~~~~~~~
280 Launches the configured visual text editor
282 Launch Difftool
283 ~~~~~~~~~~~~~~~
284 Visualize changes using `git difftool`.
286 Revert Unstaged Edits
287 ~~~~~~~~~~~~~~~~~~~~~
288 Reverts unstaged content by checking out selected paths
289 from the index/staging area
291 Revert Uncommitted Edits
292 ~~~~~~~~~~~~~~~~~~~~~~~~
293 Throws away uncommitted edits
295 Unstage Selected
296 ~~~~~~~~~~~~~~~~
297 Remove from the index/staging area with
298 `git reset <http://git-scm.com/docs/git-reset>`_
300 Launch Merge Tool
301 ~~~~~~~~~~~~~~~~~
302 Resolve conflicts using `git mergetool <http://git-scm.com/docs/git-mergetool>`_.
304 Delete File(s)
305 ~~~~~~~~~~~~~~
306 Delete untracked files from the filesystem.
308 Add to .gitignore
309 ~~~~~~~~~~~~~~~~~
310 Adds untracked files to to the .gitignore file.
312 .. _diff:
314 DIFF
315 ====
316 The diff viewer/editor displays diffs for selected files.
317 Additions are shown in green and removals are displayed in light red.
318 Extraneous whitespace is shown with a pure-red background.
320 Right-clicking in the diff provides access to additional actions
321 that use either the cursor location or text selection.
323 The "Copy Diff" action at ``Alt + Shift + C`` copies the selected lines to the
324 clipboard. The ``+``, ``-`` and `` `` diff line prefixes are stripped from each line
325 when copying diffs using the "Copy Diff" action.
327 Staging content for commit
328 --------------------------
329 The ``@@`` patterns denote a new diff hunk.  Selecting lines of diff
330 and using the `Stage Selected Lines` command will stage just the selected
331 lines.  Clicking within a diff hunk and selecting `Stage Diff Hunk` stages the
332 entire patch diff hunk.
334 The corresponding opposite commands can be performed on staged files as well,
335 e.g. staged content can be selectively removed from the index when we are
336 viewing diffs for staged content.
338 COMMIT MESSAGE EDITOR
339 =====================
341 The commit message editor is a simple text widget
342 for entering commit messages.
344 You can navigate between the `Subject` and `Extended description...`
345 fields using the keyboard arrow keys.
347 Pressing enter when inside the `Subject` field jumps down to the
348 extended description field.
350 The `Options` button menu to the left of the subject field
351 provides access to the additional actions.
353 The `Ctrl+i` keyboard shortcut adds a standard "Signed-off-by: " line,
354 and `Ctrl+Enter` creates a new commit using the commit message and
355 staged content.
357 Sign Off
358 --------
359 The `Sign Off` button adds a standard::
361     Signed-off-by: A. U. Thor <a.u.thor@example.com>
363 line to the bottom of the commit message.
365 Invoking this action is equivalent to passing the ``-s`` option
366 to `git commit <http://git-scm.com/docs/git-commit>`_.
368 Commit
369 ------
370 The commit button runs
371 `git commit <http://git-scm.com/docs/git-commit>`_.
372 The contents of the commit message editor is provided as the commit message.
374 Only staged files are included in the commit -- this is the same behavior
375 as running ``git commit`` on the command-line.
377 Line and Column Display
378 -----------------------
379 The current line and column number is displayed by the editor.
380 E.g. a ``5,0`` display means that the cursor is located at
381 line five, column zero.
383 The display changes colors when lines get too long.
384 Yellow indicates the safe boundary for sending patches to a mailing list
385 while keeping space for inline reply markers.
387 Orange indicates that the line is starting to run a bit long and should
388 break soon.
390 Red indicates that the line is running up against the standard
391 80-column limit for commit messages.
393 Keeping commit messages less than 76-characters wide is encouraged.
394 `git log <http://git-scm.com/docs/git-log>`_
395 is a great tool but long lines mess up its formatting for everyone else,
396 so please be mindful when writing commit messages.
399 Amend Last Commit
400 -----------------
401 Clicking on `Amend Last Commit` makes `git cola` amend the previous commit
402 instead of creating a new one.  `git cola` loads the previous commit message
403 into the commit message editor when this option is selected.
405 The `Status` tool will display all of the changes for the amended commit.
407 Create Signed Commit
408 --------------------
409 Tell `git commit` and `git merge` to sign commits using GPG.
411 Using this option is equivalent to passing the ``--gpg-sign`` option to
412 `git commit <http://git-scm.com/docs/git-commit>`_ and
413 `git merge <http://git-scm.com/docs/git-merge>`_.
415 This option's default value can be configured using the `cola.signcommits`
416 configuration variable.
418 Prepare Commit Message
419 ----------------------
420 The ``Commit -> Prepare Commit Message`` action or `Ctrl-Shift-Return` keyboard shortcut
421 runs the `cola-prepare-commit-msg` hook if it is available in `.git/hooks/`.
422 This is a `git cola`-specific hook that takes the same parameters
423 as Git's `prepare-commit-msg hook <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_
425 The hook is passed the path to `.git/GIT_COLA_MSG` as the first argument and the hook is expected to write
426 an updated commit message to specified path.  After running this action, the
427 commit message editor is updated with the new commit message.
429 To override the default path to this hook set the
430 `cola.prepareCommitMessageHook` `git config` variable to the path to the
431 hook script.  This is useful if you would like to use a common hook
432 across all repositories.
434 BRANCHES
435 ========
437 The `Branches` tool provides a visual tree to navigate through the branches.
438 The tree has three main nodes `Local Branch`, `Remote Branch` and `Tags`.
439 Branches are grouped by their name divided by the character '/'.Ex::
441     branch/feature/foo
442     branch/feature/bar
443     branch/doe
445 Will produce::
447     branch
448         - doe
449         + feature
450             - bar
451             - foo
453 Current branch will display a star icon. If current branch has commits
454 ahead/behind it will display an up/down arrow with its number.
456 Actions
457 -------
458 Various actions are available through the right-click context menu.
459 Different actions are available depending of selected branch status.
461 Checkout
462 ~~~~~~~~
463 The checkout action runs
464 `git checkout [<branchname>] <https://git-scm.com/docs/git-checkout>`_.
466 Merge in current branch
467 ~~~~~~~~~~~~~~~~~~~~~~~
468 The merge action runs
469 `git merge --no-commit [<branchname>] <https://git-scm.com/docs/git-merge>`_.
471 Pull
472 ~~~~
473 The pull action runs
474 `git pull --no-ff [<remote>] [<branchname>] <https://git-scm.com/docs/git-pull>`_.
476 Push
477 ~~~~
478 The push action runs
479 `git push [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
481 Rename Branch
482 ~~~~~~~~~~~~~
483 The rename branch action runs
484 `git branch -M [<branchname>] <https://git-scm.com/docs/git-push>`_.
486 Delete Branch
487 ~~~~~~~~~~~~~
488 The delete branch branch action runs
489 `git branch -D [<branchname>] <https://git-scm.com/docs/git-branch>`_.
491 Delete Remote Branch
492 ~~~~~~~~~~~~~~~~~~~~
493 The remote branch action runs
494 `git push --delete [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
497 APPLY PATCHES
498 =============
499 Use the ``File -> Apply Patches`` menu item to begin applying patches.
501 Dragging and dropping patches onto the `git cola` interface
502 adds the patches to the list of patches to apply using
503 `git am <http://git-scm.com/docs/git-am>`_.
505 You can drag either a set of patches or a directory containing patches.
506 Patches can be sorted using in the interface and are applied in the
507 same order as is listed in the list.
509 When a directory is dropped `git cola` walks the directory
510 tree in search of patches.  `git cola` sorts the list of
511 patches after they have all been found.  This allows you
512 to control the order in which patches are applied by placing
513 patchsets into alphanumerically-sorted directories.
515 CUSTOM WINDOW SETTINGS
516 ======================
517 `git cola` remembers modifications to the layout and arrangement
518 of tools within the `git cola` interface.  Changes are saved
519 and restored at application shutdown/startup.
521 `git cola` can be configured to not save custom layouts by unsetting
522 the `Save Window Settings` option in the `git cola` preferences.
524 DARK MODE AND WINDOW MANAGER THEMES
525 ===================================
526 Git Cola contains a ``default`` theme which follows the current Qt style and a
527 handful of built-in color themes.  See :ref:`cola_theme` for more details.
529 To use icons appropriate for a dark application theme, configure
530 ``git config --global cola.icontheme dark`` to use the dark icon theme.
531 See :ref:`cola_icontheme` for more details.
533 On macOS, using the ``default`` theme will automatically inherit "Dark Mode"
534 color themes when configured via System Preferences.  You will need to
535 configure the dark icon theme as noted above when dark mode is enabled.
537 On Linux, you may want Qt to follow the Window manager theme by configuring it
538 to do so using the ``qt5ct`` Qt5 configuration tool.  Install ``qt5ct`` on
539 Debian/Ubuntu systems to make this work.::
541     sudo apt install qt5ct
543 Once installed, update your `~/.bash_profile` to activate ``qt5ct``::
545     # Use the style configured using the qt5ct tool
546     export QT_QPA_PLATFORMTHEME=qt5ct
548 This only work with the `default` theme.  The other themes replace the color
549 palette with theme-specific colors.
551 Some systems may require that you override `QT_STYLE_OVERRIDE` in order to
552 use a dark theme or to better interact with the Desktop environment.
553 Some systems provide a theme that you can install::
555     sudo apt-get install adwaita-qt
557 You can activate the theme using the following environment variable::
559     # Override the default theme to adwaita-dark
560     export QT_STYLE_OVERRIDE=adwaita-dark
562 `QT_STYLE_OVERRIDE` may already be set in your Desktop Environment, so check that
563 variable for reference if you get unexpected hangs when launching `git-cola` or
564 when the default theme does not follow the desktop's theme on Linux.
566 If you don't want to set this variable globally then you can set it when launching
567 cola from the command-line::
569     QT_STYLE_OVERRIDE=adwaita-dark git cola
571 The following is a user-contributed custom `git-cola.desktop` file that can be used to
572 launch Git Cola with these settings preset for you::
574     [Desktop Entry]
575     Name=Git Cola (dark)
576     Comment=The highly caffeinated Git GUI
577     TryExec=git-cola
578     Exec=env QT_STYLE_OVERRIDE=adwaita-dark git-cola --prompt --icon-theme dark
579     Icon=git-cola
580     StartupNotify=true
581     Terminal=false
582     Type=Application
583     Categories=Development;RevisionControl;
584     X-KDE-SubstituteUID=false
586 You may also want to customize the diff colors when using a dark theme::
588     git config --global cola.color.add 86c19f
589     git config --global cola.color.remove c07067
591 Please see `#760 <https://github.com/git-cola/git-cola/issues/760>`_ for more details.
593 Custom Themes
594 -------------
595 To create your own custom theme for Git Cola just create a QSS file and put it in
596 ``~/.config/themes/``. You can add as many files as you want. Each file will become
597 an option in ``Menu -> File -> Preferences -> Appearance -> GUI theme``.
599 Some examples can be found here `Qt Style Sheets Examples <https://doc.qt.io/qt-5/stylesheet-examples.html>`_.
602 CONFIGURATION VARIABLES
603 =======================
604 These variables can be set using `git config` or from the settings.
606 cola.autocompletepaths
607 ----------------------
608 Set to `false` to disable auto-completion of filenames in completion widgets.
609 This can speed up operations when working in large repositories.
610 Defaults to `true`.
612 cola.autoloadCommitTemplate
613 ---------------------------
614 Set to `true` to automatically load the commit template in the commit message
615 editor If the commit.template variable has not been configured, raise the
616 corresponding error.
617 Defaults to `false`.
619 cola.blameviewer
620 ----------------
621 The command used to blame files.  Defaults to `git gui blame`.
623 cola.blockcursor
624 ----------------
625 Whether to use a "block" cursor in diff editors. The block cursor is easier to
626 see compared to a line cursor. Set to `false` to use a thin "line" cursor.
627 Defauls to `true`.
629 cola.browserdockable
630 --------------------
631 Whether to create a dock widget with the `Browser` tool.
632 Defaults to `false` to speedup startup time.
634 cola.checkconflicts
635 -------------------
636 Inspect unmerged files for conflict markers before staging them.
637 This feature helps prevent accidental staging of unresolved merge conflicts.
638 Defaults to `true`.
640 cola.defaultrepo
641 ----------------
642 `git cola`, when run outside of a Git repository, prompts the user for a
643 repository.  Set `cola.defaultrepo` to the path of a Git repository to make
644 `git cola` attempt to use that repository before falling back to prompting
645 the user for a repository.
647 cola.dictionary
648 ---------------
649 Specifies an additional dictionary for `git cola` to use in its spell checker.
650 This should be configured to the path of a newline-separated list of words.
652 By default, `git cola` searches for `dict/words` and `dict/propernames` dictionary
653 files in `~/.local/share` and `$XDG_DATA_DIRS`.
655 If `$XDG_DATA_DIRS` is undefined or set to an empty value then `/usr/local/share` and
656 `/usr/share` are searched for dictionary files.
658 Dictionary files are newline-separated and contain one word per line.
660 cola.expandtab
661 --------------
662 Expand tabs into spaces in the commit message editor.  When set to `true`,
663 `git cola` will insert a configurable number of spaces when tab is pressed.
664 The number of spaces is determined by `cola.tabwidth`.
665 Defaults to `false`.
667 cola.gravatar
668 -------------
669 Use the `gravatar.com` service to lookup icons for author emails.
670 Gravatar icons work by sending an MD5 hash of an author's email to `gravatar.com`
671 when requesting an icon. Warning: this feature can leak information.
672 Network requests to `gravatar.com` are disabled when set to `false`.
673 Defaults to `true`.
675 cola.fileattributes
676 -------------------
677 Enables per-file gitattributes encoding and binary file support.
678 This tells `git cola` to honor the configured encoding when displaying
679 and applying diffs.
681 A `.gitattributes` file can set the ``binary`` attribute in order to force
682 specific untracked paths to be treated as binary files when diffing.
683 Binary files are displayed using a hexdump display.
685 .. sourcecode:: sh
687    # Treat *.exr files as binary files.
688    *.exr binary
690 cola.fontdiff
691 -------------
692 Specifies the font to use for `git cola`'s diff display.
694 cola.hidpi
695 ----------
696 Specifies the High DPI displays scale factor. Set `0` to automatically scaled.
697 Setting value between 0 and 1 is undefined.
698 This option requires at least Qt 5.6 to work.
699 See `Qt QT_SCALE_FACTOR documentation <https://doc.qt.io/qt-5/highdpi.html>`_
700 for more information.
702 .. _cola_icontheme:
704 cola.icontheme
705 --------------
706 Specifies the icon themes to use throughout `git cola`. The theme specified
707 must be the name of the subdirectory containing the icons, which in turn must
708 be placed in the inside the main "icons" directory in `git cola`'s
709 installation prefix.
711 If unset, or set either "light" or "default", then the default style will be
712 used.  If set to "dark" then the built-in "dark" icon theme, which is
713 suitable for a dark window manager theme, will be used.
715 If set to an absolute directory path then icons in that directory will be used.
716 This value can be set to multiple values using,
717 ``git config --add cola.icontheme $theme``.
719 This setting can be overridden by the `GIT_COLA_ICON_THEME` environment
720 variable, which can specify multiple themes using a colon-separated value.
722 The icon theme can also be specified by passing ``--icon-theme=<theme>`` on the
723 command line, once for each icon theme, in the order that they should be
724 searched.  This can be used to override a subset of the icons, and fallback
725 to the built-in icons for the remainder.
727 cola.imagediff.[extension]
728 --------------------------
729 Enable image diffs for the specified file extension.  For example, configuring
730 `git config --global cola.imagediff.svg false` will disable use of the visual
731 image diff for `.svg` files in all repos until is is explicitly toggled on.
732 Defaults to `true`.
734 cola.inotify
735 ------------
736 Set to `false` to disable file system change monitoring.  Defaults to `true`,
737 but also requires either Linux with inotify support or Windows with `pywin32`
738 installed for file system change monitoring to actually function.
740 cola.refreshonfocus
741 -------------------
742 Set to `true` to automatically refresh when `git cola` gains focus.  Defaults
743 to `false` because this can cause a pause whenever switching to `git cola` from
744 another application.
746 cola.linebreak
747 --------------
748 Whether to automatically break long lines while editing commit messages.
749 Defaults to `true`.  This setting is configured using the `Preferences`
750 dialog, but it can be toggled for one-off usage using the commit message
751 editor's options sub-menu.
753 cola.maxrecent
754 --------------
755 `git cola` caps the number of recent repositories to avoid cluttering
756 the start and recent repositories menu.  The maximum number of repositories to
757 remember is controlled by `cola.maxrecent` and defaults to `8`.
759 cola.mousezoom
760 --------------
761 Controls whether zooming text using Ctrl + MouseWheel scroll is enabled.
762 Set to `false to disable scrolling with the mouse wheel.
763 Defauls to `true`.
765 cola.dragencoding
766 -----------------
767 `git cola` encodes paths dragged from its widgets into `utf-16` when adding
768 them to the drag-and-drop mime data (specifically, the `text/x-moz-url` entry).
769 `utf-16` is used to make `gnome-terminal` see the right paths, but other
770 terminals may expect a different encoding.  If you are using a terminal that
771 expects a modern encoding, e.g. `terminator`, then set this value to `utf-8`.
773 cola.readsize
774 -------------
775 `git cola` avoids reading large binary untracked files.
776 The maximum size to read is controlled by `cola.readsize`
777 and defaults to `2048`.
779 cola.resizebrowsercolumns
780 -------------------------
781 `git cola` will automatically resize the file browser columns as folders are
782 expanded/collapsed when ``cola.resizebrowsercolumns`` is set to `true`.
784 cola.safemode
785 -------------
786 The "Stage" button in the `git cola` Actions panel stages all files when it is
787 activated and no files are selected.  This can be problematic if it is
788 accidentally triggered after carefully preparing the index with staged
789 changes.  "Safe Mode" is enabled by setting `cola.safemode` to `true`.
790 When enabled, `git cola` will do nothing when "Stage" is activated without a
791 selection.  Defaults to `false`.
793 cola.savewindowsettings
794 -----------------------
795 `git cola` will remember its window settings when set to `true`.
796 Window settings and X11 sessions are saved in `$HOME/.config/git-cola`.
798 cola.showpath
799 -------------
800 `git cola` displays the absolute path of the repository in the window title.
801 This can be disabled by setting `cola.showpath` to `false`.
802 Defaults to `true`.
804 cola.signcommits
805 ----------------
806 `git cola` will sign commits by default when set `true`. Defaults to `false`.
807 See the section below on setting up GPG for more details.
809 cola.startupmode
810 ----------------
811 Control how the list of repositories is displayed in the startup dialog.
812 Set to `list` to view the list of repositories as a list, or `folder` to view
813 the list of repositories as a collection of folder icons.
814 Defaults to `list`.
816 cola.statusindent
817 -----------------
818 Set to `true` to indent files in the Status widget.  Files in the `Staged`,
819 `Modified`, etc. categories will be grouped in a tree-like structure.
820 Defaults to `false`.
822 cola.statusshowtotals
823 ---------------------
824 Set to `true` to display files counts in the Status widget's category titles.
825 Defaults to `false`.
827 cola.tabwidth
828 -------------
829 The number of columns occupied by a tab character.  Defaults to 8.
831 cola.terminal
832 -------------
833 The command to use when launching commands within a graphical terminal.
835 `cola.terminal` defaults to `xterm -e` when unset.
836 e.g. when opening a shell, `git cola` will run `xterm -e $SHELL`.
838 `git cola` has built-in support for `xterm`, `gnome-terminal`, `konsole`.
839 If either `gnome-terminal`, `xfce4-terminal`, or `konsole` are installed
840 then they will be preferred over `xterm` when `cola.terminal` is unset.
842 The table below shows the built-in values that are used for the respective
843 terminal.  You can force the use of a specific terminal by configuring cola
844 accordingly.
846 cola.terminalshellquote
847 -----------------------
848 Some terminal require that the command string get passed as a string.
849 For example, ``xfce4-terminal -e "git difftool"`` requires shell quoting,
850 whereas ``gnome-terminal -- git difftool`` does not.
852 You should not need to set this variable for the built-in terminals
853 cola knows about -- it will behave correctly without configuration.
854 For example, when unconfigured, cola already knows that xfce4-terminal
855 requires shell quoting.
857 This configuration variable is for custom terminals outside of the builtin set.
858 The table below shows the builtin configuration.
860 =================== ======================= =============================
861 Terminal            ``cola.terminal``       ``cola.terminalshellquote``
862 =================== ======================= =============================
863 gnome-terminal      ``gnome-terminal --``   ``false``
864 konsole             ``konsole -e``          ``false``
865 xfce4-terminal      ``xfce4-terminal -e``   ``true``
866 xterm               ``xterm -e``            ``false``
867 =================== ======================= =============================
869 cola.textwidth
870 --------------
871 The number of columns used for line wrapping.
872 Tabs are counted according to `cola.tabwidth`.
874 .. _cola_theme:
876 cola.theme
877 ----------
878 Specifies the GUI theme to use throughout `git cola`. The theme specified
879 must be one of the following values:
881 * `default` â€“ default Qt theme, may appear different on various systems
882 * `flat-dark-blue`
883 * `flat-dark-green`
884 * `flat-dark-grey`
885 * `flat-dark-red`
886 * `flat-light-blue`
887 * `flat-light-green`
888 * `flat-light-grey`
889 * `flat-light-red`
891 If unset, or set to an invalid value, then the default style will be
892 used. The `default` theme is generated by Qt internal engine and should look
893 native but may look noticeably different on different platforms. The flat
894 themes on the other hand should look similar (but not identical) on various
895 systems.
897 The GUI theme can also be specified by passing ``--theme=<name>`` on the
898 command line.
900 cola.turbo
901 ----------
902 Set to `true` to enable "turbo" mode.  "Turbo" mode disables some
903 features that can slow things down when operating on huge repositories.
904 "Turbo" mode will skip loading Git commit messages, author details, status
905 information, and commit date details in the `File Browser` tool.
906 Defaults to `false`.
908 cola.color.text
909 ---------------
910 The default diff text color, in hexadecimal #RRGGBB notation.
911 Defaults to "#030303"::
913     git config cola.color.text '#030303'
915 cola.color.add
916 --------------
917 The default diff "add" background color, in hexadecimal #RRGGBB notation.
918 Defaults to "#d2ffe4"::
920     git config cola.color.add '#d2ffe4'
922 cola.color.remove
923 -----------------
924 The default diff "remove" background color, in hexadecimal #RRGGBB notation.
925 Defaults to "#fee0e4"::
927     git config cola.color.remove '#fee0e4'
929 cola.color.header
930 -----------------
931 The default diff header text color, in hexadecimal #RRGGBB notation.
932 Defaults to "#bbbbbb"::
934     git config cola.color.header '#bbbbbb'
936 core.hooksPath
937 --------------
938 Hooks are programs you can place in a hooks directory to trigger actions at
939 certain points in git’s execution. Hooks that don’t have the executable bit
940 set are ignored.
942 By default the hooks directory is ``$GIT_DIR/hooks``, but that can
943 be changed via the ``core.hooksPath`` configuration variable
945 The ``cola-prepare-commit-msg`` hook functionality and Cola's Git LFS
946 detection honors this configuration.
948 Please see the `git hooks documentation <https://git-scm.com/docs/githooks>`_
949 for more details.
951 gui.diffcontext
952 ---------------
953 The number of diff context lines to display.
955 gui.displayuntracked
956 --------------------
957 `git cola` avoids showing untracked files when set to `false`.
959 gui.editor
960 ----------
961 The default text editor to use is defined in `gui.editor`.
962 The config variable overrides the VISUAL environment variable.
963 e.g. `gvim -f -p`.
965 gui.historybrowser
966 ------------------
967 The history browser to use when visualizing history.
968 Defaults to `gitk`.
970 diff.tool
971 ---------
972 The default diff tool to use.
974 merge.tool
975 ----------
976 The default merge tool to use.
978 user.email
979 ----------
980 Your email address to be recorded in any newly created commits.
981 Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
982 'EMAIL' environment variables.
984 user.name
985 ---------
986 Your full name to be recorded in any newly created commits.
987 Can be overridden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'
988 environment variables.
990 ENVIRONMENT VARIABLES
991 =====================
993 GIT_COLA_ICON_THEME
994 -------------------
995 When set in the environment, `GIT_COLA_ICON_THEME` overrides the
996 theme specified in the `cola.icontheme` configuration.
997 Read :ref:`cola_icontheme` for more details.
999 GIT_COLA_SCALE
1000 --------------
1001 .. Important:: `GIT_COLA_SCALE` should not be used with newer versions of Qt.
1003     Set `QT_AUTO_SCREEN_SCALE_FACTOR` to `1` and Qt will automatically
1004     scale the interface to the correct size based on the display DPI.
1005     This option is also available by setting `cola.hidpi` configuration.
1007     See the `Qt High DPI documentation <https://doc.qt.io/qt-5/highdpi.html>`_
1008     for more details.
1010 `git cola` can be made to scale its interface for HiDPI displays.
1011 When defined, `git cola` will scale icons, radioboxes, and checkboxes
1012 according to the scale factor.  The default value is `1`.
1013 A good value is `2` for high-resolution displays.
1015 Fonts are not scaled, as their size can already be set in the settings.
1017 GIT_COLA_TRACE
1018 --------------
1019 When defined, `git cola` logs `git` commands to stdout.
1020 When set to `full`, `git cola` also logs the exit status and output.
1021 When set to `trace`, `git cola` logs to the `Console` widget.
1023 VISUAL
1024 ------
1025 Specifies the default editor to use.
1026 This is ignored when the `gui.editor` configuration variable is defined.
1028 LANGUAGE SETTINGS
1029 =================
1030 `git cola` automatically detects your language and presents some
1031 translations when available.  This may not be desired, or you
1032 may want `git cola` to use a specific language.
1034 You can make `git cola` use an alternative language by creating a
1035 `~/.config/git-cola/language` file containing the standard two-letter
1036 gettext language code, e.g. "en", "de", "ja", "zh", etc.::
1038     mkdir -p ~/.config/git-cola &&
1039     echo en >~/.config/git-cola/language
1041 Alternatively you may also use LANGUAGE environmental variable to temporarily
1042 change `git cola`'s language just like any other gettext-based program.  For
1043 example to temporarily change `git cola`'s language to English::
1045     LANGUAGE=en git cola
1047 To make `git cola` use the zh_TW translation with zh_HK, zh, and en as a
1048 fallback.::
1050     LANGUAGE=zh_TW:zh_HK:zh:en git cola
1053 CUSTOM GUI ACTIONS
1054 ==================
1055 `git cola` allows you to define custom GUI actions by setting `git config`
1056 variables.  The "name" of the command appears in the "Actions" menu.
1058 guitool.<name>.cmd
1059 ------------------
1060 Specifies the shell command line to execute when the corresponding item of the
1061 Tools menu is invoked. This option is mandatory for every tool. The command is
1062 executed from the root of the working directory, and in the environment it
1063 receives the name of the tool as GIT_GUITOOL, the name of the currently
1064 selected file as FILENAME, and the name of the current branch as CUR_BRANCH
1065 (if the head is detached, CUR_BRANCH is empty).
1067 If ``<name>`` contains slashes (``/``) then the leading part of the name,
1068 up until the final slash, is treated like a path of submenus under which the
1069 actions will be created.
1071 For example, configuring ``guitool.Commands/Util/echo.cmd`` creates a
1072 ``Commands`` menu inside the top-level ``Actions`` menu, a ``Util`` menu
1073 inside the ``Commands`` menu and an ``echo`` action inside the ``Commands``
1074 submenu.
1076 guitool.<name>.background
1077 -------------------------
1078 Run the command in the background (similar to editing and difftool actions).
1079 This avoids blocking the GUI.  Setting `background` to `true` implies
1080 `noconsole` and `norescan`.
1082 guitool.<name>.needsfile
1083 ------------------------
1084 Run the tool only if a diff is selected in the GUI. It guarantees that
1085 FILENAME is not empty.
1087 guitool.<name>.noconsole
1088 ------------------------
1089 Run the command silently, without creating a window to display its output.
1091 guitool.<name>.norescan
1092 -----------------------
1093 Don’t rescan the working directory for changes after the tool finishes
1094 execution.
1096 guitool.<name>.confirm
1097 ----------------------
1098 Show a confirmation dialog before actually running the tool.
1100 guitool.<name>.argprompt
1101 ------------------------
1102 Request a string argument from the user, and pass it to the tool through the
1103 ARGS environment variable. Since requesting an argument implies confirmation,
1104 the confirm option has no effect if this is enabled. If the option is set to
1105 true, yes, or 1, the dialog uses a built-in generic prompt; otherwise the
1106 exact value of the variable is used.
1108 guitool.<name>.revprompt
1109 ------------------------
1110 Request a single valid revision from the user, and set the REVISION
1111 environment variable. In other aspects this option is similar to argprompt,
1112 and can be used together with it.
1114 guitool.<name>.revunmerged
1115 --------------------------
1116 Show only unmerged branches in the revprompt subdialog. This is useful for
1117 tools similar to merge or rebase, but not for things like checkout or reset.
1119 guitool.<name>.title
1120 --------------------
1121 Specifies the title to use for the prompt dialog.
1122 Defaults to the tool name.
1124 guitool.<name>.prompt
1125 ---------------------
1126 Specifies the general prompt string to display at the top of the dialog,
1127 before subsections for argprompt and revprompt.
1128 The default value includes the actual command.
1130 guitool.<name>.shortcut
1131 -----------------------
1132 Specifies a keyboard shortcut for the custom tool.
1134 The value must be a valid string understood by the `QAction::setShortcut()` API.
1135 See http://qt-project.org/doc/qt-4.8/qkeysequence.html#QKeySequence-2
1136 for more details about the supported values.
1138 Avoid creating shortcuts that conflict with existing built-in `git cola`
1139 shortcuts.  Creating a conflict will result in no action when the shortcut
1140 is used.
1142 SETTING UP GPG FOR SIGNED COMMITS
1143 =================================
1144 When creating signed commits, `gpg` will attempt to read your password from the
1145 terminal from which `git cola` was launched.
1146 The way to make this work smoothly is to use a GPG agent so that you can avoid
1147 needing to re-enter your password every time you commit.
1149 This also gets you a graphical passphrase prompt instead of getting prompted
1150 for your password in the terminal.
1152 Install gpg-agent and friends
1153 -----------------------------
1154 On Mac OS X, you may need to `brew install gpg-agent` and install the
1155 `Mac GPG Suite <https://gpgtools.org/macgpg2/>`_.
1157 On Linux use your package manager to install gnupg2,
1158 gnupg-agent and pinentry-qt, e.g.::
1160     sudo apt-get install gnupg2 gnupg-agent pinentry-qt
1162 On Linux, you should also configure Git so that it uses gpg2 (gnupg2),
1163 otherwise you will get errors mentioning, "unable to open /dev/tty".
1164 Set Git's `gpg.program` to `gpg2`::
1166     git config --global gpg.program gpg2
1168 Configure gpg-agent and a pin-entry program
1169 -------------------------------------------
1170 On Mac OS X, edit `~/.gnupg/gpg.conf` to include the line,::
1172     use-agent
1174 This is typically not needed on Linux, where `gpg2` is used, as
1175 this is the default value when using `gpg2`.
1177 Next, edit `~/.gnupg/gpg-agent.conf` to contain a pinentry-program line
1178 pointing to the pinentry program for your platform.
1180 The following example `~/.gnupg/gpg-agent.conf` shows how to use
1181 pinentry-gtk-2 on Linux::
1183     pinentry-program /usr/bin/pinentry-gtk-2
1184     default-cache-ttl 3600
1186 This following example `.gnupg/gpg-agent.conf` shows how to use MacGPG2's
1187 pinentry app on On Mac OS X::
1189     pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
1190     default-cache-ttl 3600
1191     enable-ssh-support
1192     use-standard-socket
1194 Once this has been set up then you will need to reload your gpg-agent config::
1196     echo RELOADAGENT | gpg-connect-agent
1198 If you see the following output::
1200     OK
1202 Then the daemon is already running, and you do not need to start it yourself.
1204 If it is not running, eval the output of ``gpg-agent --daemon`` in your shell
1205 prior to launching `git cola`.::
1207     eval $(gpg-agent --daemon)
1208     git cola
1210 WINDOWS NOTES
1211 =============
1213 Git Installation
1214 ----------------
1215 If Git is installed in a custom location, e.g. not installed in `C:/Git` or
1216 Program Files, then the path to Git must be configured by creating a file in
1217 your home directory `~/.config/git-cola/git-bindir` that points to your git
1218 installation.  e.g.::
1220     C:/Tools/Git/bin
1222 SSH Agents for Key-based Authentication
1223 ---------------------------------------
1224 You may need to setup ssh-agent in order to use SSH key-based authentication
1225 on Windows. It has been reported that starting OpenSSH agent in
1226 Windows Services and adding the key using Powershell are necessary in order
1227 to get things working.
1229 Please see the following links for more details.
1231 https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows
1233 FIPS Security Mode
1234 ==================
1235 `FIPS Security Mode <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation>`_
1236 is available in newer versions of Python. These include Python 3.9+ and the
1237 patched Python 3.6 used by CentOS8/RHEL8 (and possibly others).
1239 Git Cola uses the ``hashlib.md5`` function and adheres to the FIPS security
1240 mode when available. Git Cola does not use the MD5 value for security purposes.
1241 MD5 is used only for the purposes of implementing the ``cola/gravatar.py``
1242 Gravatar client.
1244 LINKS
1245 =====
1247 Git Cola's Git Repository
1248 -------------------------
1249 https://github.com/git-cola/git-cola/
1251 Git Cola Homepage
1252 -----------------
1253 https://git-cola.github.io/
1255 Mailing List
1256 ------------
1257 https://groups.google.com/group/git-cola