browse: display errors when saving blobs
[git-cola.git] / docs / git-cola.rst
blob0595a448f7a5cac0adf68ae5b4a9dad4f0c83c24
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 using Wayland / Gnome then you may
256 need to check whether you have ``QT_QPA_PLATFORM`` set in your environment to a value
257 other than ``wayland``. Git Cola will set this value to ``wayland`` when Wayland is
258 detected, but this setup is not performed if the ``QT_QPA_PLATFORM`` environment
259 variable is already set.
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 =====================
356 The commit message editor is a simple text widget
357 for entering commit messages.
359 You can navigate between the `Subject` and `Extended description...`
360 fields using the keyboard arrow keys.
362 Pressing enter when inside the `Subject` field jumps down to the
363 extended description field.
365 The `Options` button menu to the left of the subject field
366 provides access to the additional actions.
368 The `Ctrl+i` keyboard shortcut adds a standard "Signed-off-by: " line,
369 and `Ctrl+Enter` creates a new commit using the commit message and
370 staged content.
372 Sign Off
373 --------
374 The `Sign Off` button adds a standard::
376     Signed-off-by: A. U. Thor <a.u.thor@example.com>
378 line to the bottom of the commit message.
380 Invoking this action is equivalent to passing the ``-s`` option
381 to `git commit <http://git-scm.com/docs/git-commit>`_.
383 Commit
384 ------
385 The commit button runs
386 `git commit <http://git-scm.com/docs/git-commit>`_.
387 The contents of the commit message editor is provided as the commit message.
389 Only staged files are included in the commit -- this is the same behavior
390 as running ``git commit`` on the command-line.
392 Line and Column Display
393 -----------------------
394 The current line and column number is displayed by the editor.
395 E.g. a ``5,0`` display means that the cursor is located at
396 line five, column zero.
398 The display changes colors when lines get too long.
399 Yellow indicates the safe boundary for sending patches to a mailing list
400 while keeping space for inline reply markers.
402 Orange indicates that the line is starting to run a bit long and should
403 break soon.
405 Red indicates that the line is running up against the standard
406 80-column limit for commit messages.
408 Keeping commit messages less than 76-characters wide is encouraged.
409 `git log <http://git-scm.com/docs/git-log>`_
410 is a great tool but long lines mess up its formatting for everyone else,
411 so please be mindful when writing commit messages.
414 Amend Last Commit
415 -----------------
416 Clicking on `Amend Last Commit` makes `git cola` amend the previous commit
417 instead of creating a new one.  `git cola` loads the previous commit message
418 into the commit message editor when this option is selected.
420 The `Status` tool will display all of the changes for the amended commit.
422 Create Signed Commit
423 --------------------
424 Tell `git commit` and `git merge` to sign commits using GPG.
426 Using this option is equivalent to passing the ``--gpg-sign`` option to
427 `git commit <http://git-scm.com/docs/git-commit>`_ and
428 `git merge <http://git-scm.com/docs/git-merge>`_.
430 This option's default value can be configured using the `cola.signcommits`
431 configuration variable.
433 Prepare Commit Message
434 ----------------------
435 The ``Commit -> Prepare Commit Message`` action or `Ctrl-Shift-Return` keyboard shortcut
436 runs the `cola-prepare-commit-msg` hook if it is available in `.git/hooks/`.
437 This is a `git cola`-specific hook that takes the same parameters
438 as Git's `prepare-commit-msg hook <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_
440 The hook is passed the path to `.git/GIT_COLA_MSG` as the first argument and the hook is expected to write
441 an updated commit message to specified path.  After running this action, the
442 commit message editor is updated with the new commit message.
444 To override the default path to this hook set the
445 `cola.prepareCommitMessageHook` `git config` variable to the path to the
446 hook script.  This is useful if you would like to use a common hook
447 across all repositories.
449 BRANCHES
450 ========
452 The `Branches` tool provides a visual tree to navigate through the branches.
453 The tree has three main nodes `Local Branch`, `Remote Branch` and `Tags`.
454 Branches are grouped by their name divided by the character '/'.Ex::
456     branch/feature/foo
457     branch/feature/bar
458     branch/doe
460 Will produce::
462     branch
463         - doe
464         + feature
465             - bar
466             - foo
468 Current branch will display a star icon. If current branch has commits
469 ahead/behind it will display an up/down arrow with its number.
471 Actions
472 -------
473 Various actions are available through the right-click context menu.
474 Different actions are available depending of selected branch status.
476 Checkout
477 ~~~~~~~~
478 The checkout action runs
479 `git checkout [<branchname>] <https://git-scm.com/docs/git-checkout>`_.
481 Merge in current branch
482 ~~~~~~~~~~~~~~~~~~~~~~~
483 The merge action runs
484 `git merge --no-commit [<branchname>] <https://git-scm.com/docs/git-merge>`_.
486 Pull
487 ~~~~
488 The pull action runs
489 `git pull --no-ff [<remote>] [<branchname>] <https://git-scm.com/docs/git-pull>`_.
491 Push
492 ~~~~
493 The push action runs
494 `git push [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
496 Rename Branch
497 ~~~~~~~~~~~~~
498 The rename branch action runs
499 `git branch -M [<branchname>] <https://git-scm.com/docs/git-push>`_.
501 Delete Branch
502 ~~~~~~~~~~~~~
503 The delete branch branch action runs
504 `git branch -D [<branchname>] <https://git-scm.com/docs/git-branch>`_.
506 Delete Remote Branch
507 ~~~~~~~~~~~~~~~~~~~~
508 The remote branch action runs
509 `git push --delete [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
512 APPLY PATCHES
513 =============
514 Use the ``File -> Apply Patches`` menu item to begin applying patches.
516 Dragging and dropping patches onto the `git cola` interface
517 adds the patches to the list of patches to apply using
518 `git am <http://git-scm.com/docs/git-am>`_.
520 You can drag either a set of patches or a directory containing patches.
521 Patches can be sorted using in the interface and are applied in the
522 same order as is listed in the list.
524 When a directory is dropped `git cola` walks the directory
525 tree in search of patches.  `git cola` sorts the list of
526 patches after they have all been found.  This allows you
527 to control the order in which patches are applied by placing
528 patchsets into alphanumerically-sorted directories.
530 CUSTOM WINDOW SETTINGS
531 ======================
532 `git cola` remembers modifications to the layout and arrangement
533 of tools within the `git cola` interface.  Changes are saved
534 and restored at application shutdown/startup.
536 `git cola` can be configured to not save custom layouts by unsetting
537 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.maxrecent
769 --------------
770 `git cola` caps the number of recent repositories to avoid cluttering
771 the start and recent repositories menu.  The maximum number of repositories to
772 remember is controlled by `cola.maxrecent` and defaults to `8`.
774 cola.mousezoom
775 --------------
776 Controls whether zooming text using Ctrl + MouseWheel scroll is enabled.
777 Set to `false to disable scrolling with the mouse wheel.
778 Defauls to `true`.
780 cola.dragencoding
781 -----------------
782 `git cola` encodes paths dragged from its widgets into `utf-16` when adding
783 them to the drag-and-drop mime data (specifically, the `text/x-moz-url` entry).
784 `utf-16` is used to make `gnome-terminal` see the right paths, but other
785 terminals may expect a different encoding.  If you are using a terminal that
786 expects a modern encoding, e.g. `terminator`, then set this value to `utf-8`.
788 cola.readsize
789 -------------
790 `git cola` avoids reading large binary untracked files.
791 The maximum size to read is controlled by `cola.readsize`
792 and defaults to `2048`.
794 cola.resizebrowsercolumns
795 -------------------------
796 `git cola` will automatically resize the file browser columns as folders are
797 expanded/collapsed when ``cola.resizebrowsercolumns`` is set to `true`.
799 cola.safemode
800 -------------
801 The "Stage" button in the `git cola` Actions panel stages all files when it is
802 activated and no files are selected.  This can be problematic if it is
803 accidentally triggered after carefully preparing the index with staged
804 changes.  "Safe Mode" is enabled by setting `cola.safemode` to `true`.
805 When enabled, `git cola` will do nothing when "Stage" is activated without a
806 selection.  Defaults to `false`.
808 cola.savewindowsettings
809 -----------------------
810 `git cola` will remember its window settings when set to `true`.
811 Window settings and X11 sessions are saved in `$HOME/.config/git-cola`.
813 cola.showpath
814 -------------
815 `git cola` displays the absolute path of the repository in the window title.
816 This can be disabled by setting `cola.showpath` to `false`.
817 Defaults to `true`.
819 cola.signcommits
820 ----------------
821 `git cola` will sign commits by default when set `true`. Defaults to `false`.
822 See the section below on setting up GPG for more details.
824 cola.startupmode
825 ----------------
826 Control how the list of repositories is displayed in the startup dialog.
827 Set to `list` to view the list of repositories as a list, or `folder` to view
828 the list of repositories as a collection of folder icons.
829 Defaults to `list`.
831 cola.statusindent
832 -----------------
833 Set to `true` to indent files in the Status widget.  Files in the `Staged`,
834 `Modified`, etc. categories will be grouped in a tree-like structure.
835 Defaults to `false`.
837 cola.statusshowtotals
838 ---------------------
839 Set to `true` to display files counts in the Status widget's category titles.
840 Defaults to `false`.
842 cola.tabwidth
843 -------------
844 The number of columns occupied by a tab character.  Defaults to 8.
846 cola.terminal
847 -------------
848 The command to use when launching commands within a graphical terminal.
850 `cola.terminal` defaults to `xterm -e` when unset.
851 e.g. when opening a shell, `git cola` will run `xterm -e $SHELL`.
853 `git cola` has built-in support for `xterm`, `gnome-terminal`, `konsole`.
854 If either `gnome-terminal`, `xfce4-terminal`, or `konsole` are installed
855 then they will be preferred over `xterm` when `cola.terminal` is unset.
857 The table below shows the built-in values that are used for the respective
858 terminal.  You can force the use of a specific terminal by configuring cola
859 accordingly.
861 cola.terminalshellquote
862 -----------------------
863 Some terminal require that the command string get passed as a string.
864 For example, ``xfce4-terminal -e "git difftool"`` requires shell quoting,
865 whereas ``gnome-terminal -- git difftool`` does not.
867 You should not need to set this variable for the built-in terminals
868 cola knows about -- it will behave correctly without configuration.
869 For example, when unconfigured, cola already knows that xfce4-terminal
870 requires shell quoting.
872 This configuration variable is for custom terminals outside of the builtin set.
873 The table below shows the builtin configuration.
875 =================== ======================= =============================
876 Terminal            ``cola.terminal``       ``cola.terminalshellquote``
877 =================== ======================= =============================
878 gnome-terminal      ``gnome-terminal --``   ``false``
879 konsole             ``konsole -e``          ``false``
880 xfce4-terminal      ``xfce4-terminal -e``   ``true``
881 xterm               ``xterm -e``            ``false``
882 =================== ======================= =============================
884 cola.textwidth
885 --------------
886 The number of columns used for line wrapping.
887 Tabs are counted according to `cola.tabwidth`.
889 .. _cola_theme:
891 cola.theme
892 ----------
893 Specifies the GUI theme to use throughout `git cola`. The theme specified
894 must be one of the following values:
896 * `default` â€“ default Qt theme, may appear different on various systems
897 * `flat-dark-blue`
898 * `flat-dark-green`
899 * `flat-dark-grey`
900 * `flat-dark-red`
901 * `flat-light-blue`
902 * `flat-light-green`
903 * `flat-light-grey`
904 * `flat-light-red`
906 If unset, or set to an invalid value, then the default style will be
907 used. The `default` theme is generated by Qt internal engine and should look
908 native but may look noticeably different on different platforms. The flat
909 themes on the other hand should look similar (but not identical) on various
910 systems.
912 The GUI theme can also be specified by passing ``--theme=<name>`` on the
913 command line.
915 cola.turbo
916 ----------
917 Set to `true` to enable "turbo" mode.  "Turbo" mode disables some
918 features that can slow things down when operating on huge repositories.
919 "Turbo" mode will skip loading Git commit messages, author details, status
920 information, and commit date details in the `File Browser` tool.
921 Defaults to `false`.
923 cola.color.text
924 ---------------
925 The default diff text color, in hexadecimal #RRGGBB notation.
926 Defaults to "#030303"::
928     git config cola.color.text '#030303'
930 cola.color.add
931 --------------
932 The default diff "add" background color, in hexadecimal #RRGGBB notation.
933 Defaults to "#d2ffe4"::
935     git config cola.color.add '#d2ffe4'
937 cola.color.remove
938 -----------------
939 The default diff "remove" background color, in hexadecimal #RRGGBB notation.
940 Defaults to "#fee0e4"::
942     git config cola.color.remove '#fee0e4'
944 cola.color.header
945 -----------------
946 The default diff header text color, in hexadecimal #RRGGBB notation.
947 Defaults to "#bbbbbb"::
949     git config cola.color.header '#bbbbbb'
951 core.hooksPath
952 --------------
953 Hooks are programs you can place in a hooks directory to trigger actions at
954 certain points in git’s execution. Hooks that don’t have the executable bit
955 set are ignored.
957 By default the hooks directory is ``$GIT_DIR/hooks``, but that can
958 be changed via the ``core.hooksPath`` configuration variable
960 The ``cola-prepare-commit-msg`` hook functionality and Cola's Git LFS
961 detection honors this configuration.
963 Please see the `git hooks documentation <https://git-scm.com/docs/githooks>`_
964 for more details.
966 gui.diffcontext
967 ---------------
968 The number of diff context lines to display.
970 gui.displayuntracked
971 --------------------
972 `git cola` avoids showing untracked files when set to `false`.
974 gui.editor
975 ----------
976 The default text editor to use is defined in `gui.editor`.
977 The config variable overrides the VISUAL environment variable.
978 e.g. `gvim -f -p`.
980 gui.historybrowser
981 ------------------
982 The history browser to use when visualizing history.
983 Defaults to `gitk`.
985 diff.tool
986 ---------
987 The default diff tool to use.
989 merge.tool
990 ----------
991 The default merge tool to use.
993 user.email
994 ----------
995 Your email address to be recorded in any newly created commits.
996 Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
997 'EMAIL' environment variables.
999 user.name
1000 ---------
1001 Your full name to be recorded in any newly created commits.
1002 Can be overridden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'
1003 environment variables.
1005 ENVIRONMENT VARIABLES
1006 =====================
1008 GIT_COLA_ICON_THEME
1009 -------------------
1010 When set in the environment, `GIT_COLA_ICON_THEME` overrides the
1011 theme specified in the `cola.icontheme` configuration.
1012 Read :ref:`cola_icontheme` for more details.
1014 GIT_COLA_SCALE
1015 --------------
1016 .. Important:: `GIT_COLA_SCALE` should not be used with newer versions of Qt.
1018     Set `QT_AUTO_SCREEN_SCALE_FACTOR` to `1` and Qt will automatically
1019     scale the interface to the correct size based on the display DPI.
1020     This option is also available by setting `cola.hidpi` configuration.
1022     See the `Qt High DPI documentation <https://doc.qt.io/qt-5/highdpi.html>`_
1023     for more details.
1025 `git cola` can be made to scale its interface for HiDPI displays.
1026 When defined, `git cola` will scale icons, radioboxes, and checkboxes
1027 according to the scale factor.  The default value is `1`.
1028 A good value is `2` for high-resolution displays.
1030 Fonts are not scaled, as their size can already be set in the settings.
1032 GIT_COLA_TRACE
1033 --------------
1034 When defined, `git cola` logs `git` commands to stdout.
1035 When set to `full`, `git cola` also logs the exit status and output.
1036 When set to `trace`, `git cola` logs to the `Console` widget.
1038 VISUAL
1039 ------
1040 Specifies the default editor to use.
1041 This is ignored when the `gui.editor` configuration variable is defined.
1043 LANGUAGE SETTINGS
1044 =================
1045 `git cola` automatically detects your language and presents some
1046 translations when available.  This may not be desired, or you
1047 may want `git cola` to use a specific language.
1049 You can make `git cola` use an alternative language by creating a
1050 `~/.config/git-cola/language` file containing the standard two-letter
1051 gettext language code, e.g. "en", "de", "ja", "zh", etc.::
1053     mkdir -p ~/.config/git-cola &&
1054     echo en >~/.config/git-cola/language
1056 Alternatively you may also use LANGUAGE environmental variable to temporarily
1057 change `git cola`'s language just like any other gettext-based program.  For
1058 example to temporarily change `git cola`'s language to English::
1060     LANGUAGE=en git cola
1062 To make `git cola` use the zh_TW translation with zh_HK, zh, and en as a
1063 fallback.::
1065     LANGUAGE=zh_TW:zh_HK:zh:en git cola
1068 CUSTOM GUI ACTIONS
1069 ==================
1070 `git cola` allows you to define custom GUI actions by setting `git config`
1071 variables.  The "name" of the command appears in the "Actions" menu.
1073 guitool.<name>.cmd
1074 ------------------
1075 Specifies the shell command line to execute when the corresponding item of the
1076 Tools menu is invoked. This option is mandatory for every tool. The command is
1077 executed from the root of the working directory, and in the environment it
1078 receives the name of the tool as GIT_GUITOOL, the name of the currently
1079 selected file as FILENAME, and the name of the current branch as CUR_BRANCH
1080 (if the head is detached, CUR_BRANCH is empty).
1082 If ``<name>`` contains slashes (``/``) then the leading part of the name,
1083 up until the final slash, is treated like a path of submenus under which the
1084 actions will be created.
1086 For example, configuring ``guitool.Commands/Util/echo.cmd`` creates a
1087 ``Commands`` menu inside the top-level ``Actions`` menu, a ``Util`` menu
1088 inside the ``Commands`` menu and an ``echo`` action inside the ``Commands``
1089 submenu.
1091 guitool.<name>.background
1092 -------------------------
1093 Run the command in the background (similar to editing and difftool actions).
1094 This avoids blocking the GUI.  Setting `background` to `true` implies
1095 `noconsole` and `norescan`.
1097 guitool.<name>.needsfile
1098 ------------------------
1099 Run the tool only if a diff is selected in the GUI. It guarantees that
1100 FILENAME is not empty.
1102 guitool.<name>.noconsole
1103 ------------------------
1104 Run the command silently, without creating a window to display its output.
1106 guitool.<name>.norescan
1107 -----------------------
1108 Don’t rescan the working directory for changes after the tool finishes
1109 execution.
1111 guitool.<name>.confirm
1112 ----------------------
1113 Show a confirmation dialog before actually running the tool.
1115 guitool.<name>.argprompt
1116 ------------------------
1117 Request a string argument from the user, and pass it to the tool through the
1118 ARGS environment variable. Since requesting an argument implies confirmation,
1119 the confirm option has no effect if this is enabled. If the option is set to
1120 true, yes, or 1, the dialog uses a built-in generic prompt; otherwise the
1121 exact value of the variable is used.
1123 guitool.<name>.revprompt
1124 ------------------------
1125 Request a single valid revision from the user, and set the REVISION
1126 environment variable. In other aspects this option is similar to argprompt,
1127 and can be used together with it.
1129 guitool.<name>.revunmerged
1130 --------------------------
1131 Show only unmerged branches in the revprompt subdialog. This is useful for
1132 tools similar to merge or rebase, but not for things like checkout or reset.
1134 guitool.<name>.title
1135 --------------------
1136 Specifies the title to use for the prompt dialog.
1137 Defaults to the tool name.
1139 guitool.<name>.prompt
1140 ---------------------
1141 Specifies the general prompt string to display at the top of the dialog,
1142 before subsections for argprompt and revprompt.
1143 The default value includes the actual command.
1145 guitool.<name>.shortcut
1146 -----------------------
1147 Specifies a keyboard shortcut for the custom tool.
1149 The value must be a valid string understood by the `QAction::setShortcut()` API.
1150 See http://qt-project.org/doc/qt-4.8/qkeysequence.html#QKeySequence-2
1151 for more details about the supported values.
1153 Avoid creating shortcuts that conflict with existing built-in `git cola`
1154 shortcuts.  Creating a conflict will result in no action when the shortcut
1155 is used.
1157 SETTING UP GPG FOR SIGNED COMMITS
1158 =================================
1159 When creating signed commits, `gpg` will attempt to read your password from the
1160 terminal from which `git cola` was launched.
1161 The way to make this work smoothly is to use a GPG agent so that you can avoid
1162 needing to re-enter your password every time you commit.
1164 This also gets you a graphical passphrase prompt instead of getting prompted
1165 for your password in the terminal.
1167 Install gpg-agent and friends
1168 -----------------------------
1169 On Mac OS X, you may need to `brew install gpg-agent` and install the
1170 `Mac GPG Suite <https://gpgtools.org/macgpg2/>`_.
1172 On Linux use your package manager to install gnupg2,
1173 gnupg-agent and pinentry-qt, e.g.::
1175     sudo apt-get install gnupg2 gnupg-agent pinentry-qt
1177 On Linux, you should also configure Git so that it uses gpg2 (gnupg2),
1178 otherwise you will get errors mentioning, "unable to open /dev/tty".
1179 Set Git's `gpg.program` to `gpg2`::
1181     git config --global gpg.program gpg2
1183 Configure gpg-agent and a pin-entry program
1184 -------------------------------------------
1185 On Mac OS X, edit `~/.gnupg/gpg.conf` to include the line,::
1187     use-agent
1189 This is typically not needed on Linux, where `gpg2` is used, as
1190 this is the default value when using `gpg2`.
1192 Next, edit `~/.gnupg/gpg-agent.conf` to contain a pinentry-program line
1193 pointing to the pinentry program for your platform.
1195 The following example `~/.gnupg/gpg-agent.conf` shows how to use
1196 pinentry-gtk-2 on Linux::
1198     pinentry-program /usr/bin/pinentry-gtk-2
1199     default-cache-ttl 3600
1201 This following example `.gnupg/gpg-agent.conf` shows how to use MacGPG2's
1202 pinentry app on On Mac OS X::
1204     pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
1205     default-cache-ttl 3600
1206     enable-ssh-support
1207     use-standard-socket
1209 Once this has been set up then you will need to reload your gpg-agent config::
1211     echo RELOADAGENT | gpg-connect-agent
1213 If you see the following output::
1215     OK
1217 Then the daemon is already running, and you do not need to start it yourself.
1219 If it is not running, eval the output of ``gpg-agent --daemon`` in your shell
1220 prior to launching `git cola`.::
1222     eval $(gpg-agent --daemon)
1223     git cola
1225 WINDOWS NOTES
1226 =============
1228 Git Installation
1229 ----------------
1230 If Git is installed in a custom location, e.g. not installed in `C:/Git` or
1231 Program Files, then the path to Git must be configured by creating a file in
1232 your home directory `~/.config/git-cola/git-bindir` that points to your git
1233 installation.  e.g.::
1235     C:/Tools/Git/bin
1237 SSH Agents for Key-based Authentication
1238 ---------------------------------------
1239 You may need to setup ssh-agent in order to use SSH key-based authentication
1240 on Windows. It has been reported that starting OpenSSH agent in
1241 Windows Services and adding the key using Powershell are necessary in order
1242 to get things working.
1244 Please see the following links for more details.
1246 https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows
1248 FIPS Security Mode
1249 ==================
1250 `FIPS Security Mode <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation>`_
1251 is available in newer versions of Python. These include Python 3.9+ and the
1252 patched Python 3.6 used by CentOS8/RHEL8 (and possibly others).
1254 Git Cola uses the ``hashlib.md5`` function and adheres to the FIPS security
1255 mode when available. Git Cola does not use the MD5 value for security purposes.
1256 MD5 is used only for the purposes of implementing the ``cola/gravatar.py``
1257 Gravatar client.
1259 LINKS
1260 =====
1262 Git Cola's Git Repository
1263 -------------------------
1264 https://github.com/git-cola/git-cola/
1266 Git Cola Homepage
1267 -----------------
1268 https://git-cola.github.io/
1270 Mailing List
1271 ------------
1272 https://groups.google.com/group/git-cola