CHANGES: update v4.0.2 release notes draft
[git-cola.git] / docs / git-cola.rst
blobf989b5fab39a45e71685d76fd47706313cd7da3a
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 KEYBOARD SHORTCUTS
145 ==================
146 `git cola` has many useful keyboard shortcuts.
148 Many of `git cola`'s editors understand vim-style hotkeys, eg. `{h,j,k,l}`
149 for navigating in the diff, status, grep, and file browser widgets.
151 `{d,u}` move down/up one half page at a time (similar to vim's `ctrl-{d,u}`).
152 The `space` and `shift-space` hotkeys are mapped to the same operations.
154 `Shift-{j,k,d,u,f,b,page-up,page-down,left,right,up,down}` can be be used in
155 the diff editor to select lines while navigating.
157 `s` is a useful hotkey in the diff editor.  It stages/unstages the current
158 selection when a selection is present.  When nothing is selected, the
159 diff hunk at the current text cursor position is staged.  This makes it very
160 easy to review changes by selecting good hunks with `s` while navigating down
161 and over hunks that are not going to be staged.
163 `Ctrl-u` in the diff editor reverts unstaged edits, and respects the
164 selection.  This is useful for selectively reverted edits from the worktree.
165 This same hotkey reverts the entire file when used from the status tool.
167 `Ctrl-s` in the diff editor and status tools stages/unstages the entire file.
169 You can see the available shortcuts by pressing pressing the ``?`` key,
170 choosing ``Help -> Keyboard shortcuts`` from the main menu,
171 or by consulting the `git cola keyboard shortcuts reference <https://git-cola.github.io/share/doc/git-cola/hotkeys.html>`_.
173 TOOLS
174 =====
175 The `git cola` interface is composed of various cooperating tools.
176 Double-clicking a tool opens it in its own subwindow.
177 Dragging it around moves and places it within the main window.
179 Tools can be hidden and rearranged however you like.
180 `git cola` carefully remembers your window layout and restores
181 it the next time it is launched.
183 The `Control-{1, 2, 3, ...}` hotkey gives focus to a specific tool.
184 A hidden tool can be re-opened using the `Tools` menu or
185 the `Shift+Control-{1, 2, 3, ...}` shortcut keys.
187 The Diff editor can be focused with `Ctrl-j`.
188 the Status tool can be focused with `Ctrl-k`.
189 the Commit tool can be focused with `Ctrl-l`.
191 .. _status:
193 STATUS
194 ======
195 The `Status` tool provides a visual analog to the
196 `git status <http://git-scm.com/docs/git-status>`_ command.
198 `Status` displays files that are `modified` relative to the staging area,
199 `staged` for the next commit, `unmerged` files from an in-progress merge,
200 and files that are `untracked` to git.
202 These are the same categories one sees when running
203 `git status <http://git-scm.com/docs/git-status>`_
204 on the command line.
206 You can navigate through the list of files using keyboard arrows as well
207 as the ergonomical and vim-like `j` and `k` shortcut keys.
209 There are several convenient ways to interact with files in the `Status` tool.
211 Selecting a file displays its diff in the :ref:`Diff` viewer.
212 Double-clicking a file stages its contents, as does the
213 the `Ctrl-s` shortcut key.
215 `Ctrl-e` opens selected files in the conifgured editor, and
216 `Ctrl-d` opens selected files using `git difftool <http://git-scm.com/docs/git-difftool>`_
218 Additional actions can be performed using the right-click context menu.
220 Actions
221 -------
222 Clicking the `Staged` folder shows a diffstat for the index.
224 Clicking the `Modified` folder shows a diffstat for the worktree.
226 Clicking individual files sends diffs to the `Diff Display`.
228 Double-clicking individual files adds and removes their content from the index.
230 Various actions are available through the right-click context menu.
231 Different actions are available depending a file's status.
233 Stage Selected
234 ~~~~~~~~~~~~~~
235 Add to the staging area using `git add <http://git-scm.com/docs/git-add>`_
236 Marks unmerged files as resolved.
238 Launch Editor
239 ~~~~~~~~~~~~~
240 Launches the configured visual text editor
242 Launch Difftool
243 ~~~~~~~~~~~~~~~
244 Visualize changes using `git difftool`.
246 Revert Unstaged Edits
247 ~~~~~~~~~~~~~~~~~~~~~
248 Reverts unstaged content by checking out selected paths
249 from the index/staging area
251 Revert Uncommitted Edits
252 ~~~~~~~~~~~~~~~~~~~~~~~~
253 Throws away uncommitted edits
255 Unstage Selected
256 ~~~~~~~~~~~~~~~~
257 Remove from the index/staging area with
258 `git reset <http://git-scm.com/docs/git-reset>`_
260 Launch Merge Tool
261 ~~~~~~~~~~~~~~~~~
262 Resolve conflicts using `git mergetool <http://git-scm.com/docs/git-mergetool>`_.
264 Delete File(s)
265 ~~~~~~~~~~~~~~
266 Delete untracked files from the filesystem.
268 Add to .gitignore
269 ~~~~~~~~~~~~~~~~~
270 Adds untracked files to to the .gitignore file.
272 .. _diff:
274 DIFF
275 ====
276 The diff viewer/editor displays diffs for selected files.
277 Additions are shown in green and removals are displayed in light red.
278 Extraneous whitespace is shown with a pure-red background.
280 Right-clicking in the diff provides access to additional actions
281 that use either the cursor location or text selection.
283 Staging content for commit
284 --------------------------
285 The ``@@`` patterns denote a new diff hunk.  Selecting lines of diff
286 and using the `Stage Selected Lines` command will stage just the selected
287 lines.  Clicking within a diff hunk and selecting `Stage Diff Hunk` stages the
288 entire patch diff hunk.
290 The corresponding opposite commands can be performed on staged files as well,
291 e.g. staged content can be selectively removed from the index when we are
292 viewing diffs for staged content.
294 COMMIT MESSAGE EDITOR
295 =====================
297 The commit message editor is a simple text widget
298 for entering commit messages.
300 You can navigate between the `Subject` and `Extended description...`
301 fields using the keyboard arrow keys.
303 Pressing enter when inside the `Subject` field jumps down to the
304 extended description field.
306 The `Options` button menu to the left of the subject field
307 provides access to the additional actions.
309 The `Ctrl+i` keyboard shortcut adds a standard "Signed-off-by: " line,
310 and `Ctrl+Enter` creates a new commit using the commit message and
311 staged content.
313 Sign Off
314 --------
315 The `Sign Off` button adds a standard::
317     Signed-off-by: A. U. Thor <a.u.thor@example.com>
319 line to the bottom of the commit message.
321 Invoking this action is equivalent to passing the ``-s`` option
322 to `git commit <http://git-scm.com/docs/git-commit>`_.
324 Commit
325 ------
326 The commit button runs
327 `git commit <http://git-scm.com/docs/git-commit>`_.
328 The contents of the commit message editor is provided as the commit message.
330 Only staged files are included in the commit -- this is the same behavior
331 as running ``git commit`` on the command-line.
333 Line and Column Display
334 -----------------------
335 The current line and column number is displayed by the editor.
336 E.g. a ``5,0`` display means that the cursor is located at
337 line five, column zero.
339 The display changes colors when lines get too long.
340 Yellow indicates the safe boundary for sending patches to a mailing list
341 while keeping space for inline reply markers.
343 Orange indicates that the line is starting to run a bit long and should
344 break soon.
346 Red indicates that the line is running up against the standard
347 80-column limit for commit messages.
349 Keeping commit messages less than 76-characters wide is encouraged.
350 `git log <http://git-scm.com/docs/git-log>`_
351 is a great tool but long lines mess up its formatting for everyone else,
352 so please be mindful when writing commit messages.
355 Amend Last Commit
356 -----------------
357 Clicking on `Amend Last Commit` makes `git cola` amend the previous commit
358 instead of creating a new one.  `git cola` loads the previous commit message
359 into the commit message editor when this option is selected.
361 The `Status` tool will display all of the changes for the amended commit.
363 Create Signed Commit
364 --------------------
365 Tell `git commit` and `git merge` to sign commits using GPG.
367 Using this option is equivalent to passing the ``--gpg-sign`` option to
368 `git commit <http://git-scm.com/docs/git-commit>`_ and
369 `git merge <http://git-scm.com/docs/git-merge>`_.
371 This option's default value can be configured using the `cola.signcommits`
372 configuration variable.
374 Prepare Commit Message
375 ----------------------
376 The ``Commit -> Prepare Commit Message`` action or `Ctrl-Shift-Return` keyboard shortcut
377 runs the `cola-prepare-commit-msg` hook if it is available in `.git/hooks/`.
378 This is a `git cola`-specific hook that takes the same parameters
379 as Git's `prepare-commit-msg hook <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_
381 The hook is passed the path to `.git/GIT_COLA_MSG` as the first argument and the hook is expected to write
382 an updated commit message to specified path.  After running this action, the
383 commit message editor is updated with the new commit message.
385 To override the default path to this hook set the
386 `cola.prepareCommitMessageHook` `git config` variable to the path to the
387 hook script.  This is useful if you would like to use a common hook
388 across all repositories.
390 BRANCHES
391 ========
393 The `Branches` tool provides a visual tree to navigate through the branches.
394 The tree has three main nodes `Local Branch`, `Remote Branch` and `Tags`.
395 Branches are grouped by their name divided by the character '/'.Ex::
397     branch/feature/foo
398     branch/feature/bar
399     branch/doe
401 Will produce::
403     branch
404         - doe
405         + feature
406             - bar
407             - foo
409 Current branch will display a star icon. If current branch has commits
410 ahead/behind it will display an up/down arrow with its number.
412 Actions
413 -------
414 Various actions are available through the right-click context menu.
415 Different actions are available depending of selected branch status.
417 Checkout
418 ~~~~~~~~
419 The checkout action runs
420 `git checkout [<branchname>] <https://git-scm.com/docs/git-checkout>`_.
422 Merge in current branch
423 ~~~~~~~~~~~~~~~~~~~~~~~
424 The merge action runs
425 `git merge --no-commit [<branchname>] <https://git-scm.com/docs/git-merge>`_.
427 Pull
428 ~~~~
429 The pull action runs
430 `git pull --no-ff [<remote>] [<branchname>] <https://git-scm.com/docs/git-pull>`_.
432 Push
433 ~~~~
434 The push action runs
435 `git push [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
437 Rename Branch
438 ~~~~~~~~~~~~~
439 The rename branch action runs
440 `git branch -M [<branchname>] <https://git-scm.com/docs/git-push>`_.
442 Delete Branch
443 ~~~~~~~~~~~~~
444 The delete branch branch action runs
445 `git branch -D [<branchname>] <https://git-scm.com/docs/git-branch>`_.
447 Delete Remote Branch
448 ~~~~~~~~~~~~~~~~~~~~
449 The remote branch action runs
450 `git push --delete [<remote>] [<branchname>] <https://git-scm.com/docs/git-push>`_.
453 APPLY PATCHES
454 =============
455 Use the ``File -> Apply Patches`` menu item to begin applying patches.
457 Dragging and dropping patches onto the `git cola` interface
458 adds the patches to the list of patches to apply using
459 `git am <http://git-scm.com/docs/git-am>`_.
461 You can drag either a set of patches or a directory containing patches.
462 Patches can be sorted using in the interface and are applied in the
463 same order as is listed in the list.
465 When a directory is dropped `git cola` walks the directory
466 tree in search of patches.  `git cola` sorts the list of
467 patches after they have all been found.  This allows you
468 to control the order in which patches are applied by placing
469 patchsets into alphanumerically-sorted directories.
471 CUSTOM WINDOW SETTINGS
472 ======================
473 `git cola` remembers modifications to the layout and arrangement
474 of tools within the `git cola` interface.  Changes are saved
475 and restored at application shutdown/startup.
477 `git cola` can be configured to not save custom layouts by unsetting
478 the `Save Window Settings` option in the `git cola` preferences.
480 DARK MODE AND WINDOW MANAGER THEMES
481 ===================================
482 Git Cola contains a ``default`` theme which follows the current Qt style and a
483 handful of built-in color themes.  See :ref:`cola_theme` for more details.
485 To use icons appropriate for a dark application theme, configure
486 ``git config --global cola.icontheme dark`` to use the dark icon theme.
487 See :ref:`cola_icontheme` for more details.
489 On macOS, using the ``default`` theme will automatically inherit "Dark Mode"
490 color themes when configured via System Preferences.  You will need to
491 configure the dark icon theme as noted above when dark mode is enabled.
493 On Linux, you may want Qt to follow the Window manager theme by configuring it
494 to do so using the ``qt5ct`` Qt5 configuration tool.  Install ``qt5ct`` on
495 Debian/Ubuntu systems to make this work.::
497     sudo apt install qt5ct
499 Once installed, update your `~/.bash_profile` to activate ``qt5ct``::
501     # Use the style configured using the qt5ct tool
502     export QT_QPA_PLATFORMTHEME=qt5ct
504 This only work with the `default` theme.  The other themes replace the color
505 palette with theme-specific colors.
507 Some systems may require that you override `QT_STYLE_OVERRIDE` in order to
508 use a dark theme or to better interact with the Desktop environment.
509 Some systems provide a theme that you can install::
511     sudo apt-get install adwaita-qt
513 You can activate the theme using the following enviornment variable::
515     # Override the default theme to adwait-dark
516     export QT_STYLE_OVERRIDE=adwaita-dark
518 `QT_STYLE_OVERRIDE` may already be set in your Desktop Environment, so check that
519 variable for reference if you get unexpected hangs when launching `git-cola` or
520 when the default theme does not follow the desktop's theme on Linux.
522 If you don't want to set this variable globally then you can set it when launching
523 cola from the command-line::
525     QT_STYLE_OVERRIDE=adwaita-dark git cola
527 The following is a user-contributed custom `git-cola.desktop` file that can be used to
528 launch Git Cola with these settings preset for you::
530     [Desktop Entry]
531     Name=Git Cola (dark)
532     Comment=The highly caffeinated Git GUI
533     TryExec=git-cola
534     Exec=env QT_STYLE_OVERRIDE=adwaita-dark git-cola --prompt --icon-theme dark
535     Icon=git-cola
536     StartupNotify=true
537     Terminal=false
538     Type=Application
539     Categories=Development;RevisionControl;
540     X-KDE-SubstituteUID=false
542 You may also want to customize the diff colors when using a dark theme::
544     git config --global cola.color.add 86c19f
545     git config --global cola.color.remove c07067
547 Please see `#760 <https://github.com/git-cola/git-cola/issues/760>`_ for more details.
549 Custom Themes
550 -------------
551 To create your own custom theme for Git Cola just create a QSS file and put it in
552 ``~/.config/themes/``. You can add as many files as you want. Each file will become
553 an option in ``Menu -> File -> Preferences -> Appearance -> GUI theme``.
555 Some examples can be found here `Qt Style Sheets Examples <https://doc.qt.io/qt-5/stylesheet-examples.html>`_.
558 CONFIGURATION VARIABLES
559 =======================
560 These variables can be set using `git config` or from the settings.
562 cola.autocompletepaths
563 ----------------------
564 Set to `false` to disable auto-completion of filenames in completion widgets.
565 This can speed up operations when working in large repositories.
566 Defaults to `true`.
568 cola.autoloadCommitTemplate
569 ---------------------------
570 Set to `true` to automatically load the commit template in the commit message
571 editor If the commit.template variable has not been configured, raise the
572 corresponding error.
573 Defaults to `false`.
575 cola.blameviewer
576 ----------------
577 The command used to blame files.  Defaults to `git gui blame`.
579 cola.browserdockable
580 --------------------
581 Whether to create a dock widget with the `Browser` tool.
582 Defaults to `false` to speedup startup time.
584 cola.checkconflicts
585 -------------------
586 Inspect unmerged files for conflict markers before staging them.
587 This feature helps prevent accidental staging of unresolved merge conflicts.
588 Defaults to `true`.
590 cola.defaultrepo
591 ----------------
592 `git cola`, when run outside of a Git repository, prompts the user for a
593 repository.  Set `cola.defaultrepo` to the path of a Git repository to make
594 `git cola` attempt to use that repository before falling back to prompting
595 the user for a repository.
597 cola.dictionary
598 ---------------
599 Specifies an additional dictionary for `git cola` to use in its spell checker.
600 This should be configured to the path of a newline-separated list of words.
602 cola.expandtab
603 --------------
604 Expand tabs into spaces in the commit message editor.  When set to `true`,
605 `git cola` will insert a configurable number of spaces when tab is pressed.
606 The number of spaces is determined by `cola.tabwidth`.
607 Defaults to `false`.
609 cola.fileattributes
610 -------------------
611 Enables per-file gitattributes encoding and binary file support.
612 This tells `git cola` to honor the configured encoding when displaying
613 and applying diffs.
615 A `.gitattributes` file can set the ``binary`` attribute in order to force
616 specific untracked paths to be treated as binary files when diffing.
617 Binary files are displayed using a hexdump display.
619 .. sourcecode:: sh
621    # Treat *.exr files as binary files.
622    *.exr binary
624 cola.fontdiff
625 -------------
626 Specifies the font to use for `git cola`'s diff display.
628 cola.hidpi
629 -------------
630 Specifies the High DPI displays scale factor. Set `0` to automatically scaled.
631 Setting value between 0 and 1 is undefined.
632 This option requires at least Qt 5.6 to work.
633 See `Qt QT_SCALE_FACTOR documentation <https://doc.qt.io/qt-5/highdpi.html>`_
634 for more information.
636 .. _cola_icontheme:
638 cola.icontheme
639 --------------
640 Specifies the icon themes to use throughout `git cola`. The theme specified
641 must be the name of the subdirectory containing the icons, which in turn must
642 be placed in the inside the main "icons" directory in `git cola`'s
643 installation prefix.
645 If unset, or set either "light" or "default", then the default style will be
646 used.  If set to "dark" then the built-in "dark" icon theme, which is
647 suitable for a dark window manager theme, will be used.
649 If set to an absolute directory path then icons in that directory will be used.
650 This value can be set to multiple values using,
651 ``git config --add cola.icontheme $theme``.
653 This setting can be overridden by the `GIT_COLA_ICON_THEME` environment
654 variable, which can specify multiple themes using a colon-separated value.
656 The icon theme can also be specified by passing ``--icon-theme=<theme>`` on the
657 command line, once for each icon theme, in the order that they should be
658 searched.  This can be used to override a subset of the icons, and fallback
659 to the built-in icons for the remainder.
661 cola.imagediff.<extension>
662 --------------------------
663 Enable image diffs for the specified file extension.  For example, configuring
664 `git config --global cola.imagediff.svg false` will disable use of the visual
665 image diff for `.svg` files in all repos until is is explicitly toggled on.
666 Defaults to `true`.
668 cola.inotify
669 ------------
670 Set to `false` to disable file system change monitoring.  Defaults to `true`,
671 but also requires either Linux with inotify support or Windows with `pywin32`
672 installed for file system change monitoring to actually function.
674 cola.refreshonfocus
675 -------------------
676 Set to `true` to automatically refresh when `git cola` gains focus.  Defaults
677 to `false` because this can cause a pause whenever switching to `git cola` from
678 another application.
680 cola.linebreak
681 --------------
682 Whether to automatically break long lines while editing commit messages.
683 Defaults to `true`.  This setting is configured using the `Preferences`
684 dialog, but it can be toggled for one-off usage using the commit message
685 editor's options sub-menu.
687 cola.maxrecent
688 --------------
689 `git cola` caps the number of recent repositories to avoid cluttering
690 the start and recent repositories menu.  The maximum number of repositories to
691 remember is controlled by `cola.maxrecent` and defaults to `8`.
693 cola.dragencoding
694 -----------------
695 `git cola` encodes paths dragged from its widgets into `utf-16` when adding
696 them to the drag-and-drop mime data (specifically, the `text/x-moz-url` entry).
697 `utf-16` is used to make `gnome-terminal` see the right paths, but other
698 terminals may expect a different encoding.  If you are using a terminal that
699 expects a modern encoding, e.g. `terminator`, then set this value to `utf-8`.
701 cola.readsize
702 -------------
703 `git cola` avoids reading large binary untracked files.
704 The maximum size to read is controlled by `cola.readsize`
705 and defaults to `2048`.
707 cola.resizebrowsercolumns
708 -------------------------
709 `git cola` will automatically resize the file browser columns as folders are
710 expanded/collapsed when ``cola.resizebrowsercolumns`` is set to `true`.
712 cola.safemode
713 -------------
714 The "Stage" button in the `git cola` Actions panel stages all files when it is
715 activated and no files are selected.  This can be problematic if it is
716 accidentally triggered after carefully preparing the index with staged
717 changes.  "Safe Mode" is enabled by setting `cola.safemode` to `true`.
718 When enabled, `git cola` will do nothing when "Stage" is activated without a
719 selection.  Defaults to `false`.
721 cola.savewindowsettings
722 -----------------------
723 `git cola` will remember its window settings when set to `true`.
724 Window settings and X11 sessions are saved in `$HOME/.config/git-cola`.
726 cola.showpath
727 -------------
728 `git cola` displays the absolute path of the repository in the window title.
729 This can be disabled by setting `cola.showpath` to `false`.
730 Defaults to `true`.
732 cola.signcommits
733 ----------------
734 `git cola` will sign commits by default when set `true`. Defaults to `false`.
735 See the section below on setting up GPG for more details.
737 cola.startupmode
738 ----------------
739 Control how the list of repositories is displayed in the startup dialog.
740 Set to `list` to view the list of repositories as a list, or `folder` to view
741 the list of repositories as a collection of folder icons.
742 Defaults to `list`.
744 cola.statusindent
745 -----------------
746 Set to `true` to indent files in the Status widget.  Files in the `Staged`,
747 `Modified`, etc. categories will be grouped in a tree-like structure.
748 Defaults to `false`.
750 cola.statusshowtotals
751 ---------------------
752 Set to `true` to display files counts in the Status widget's category titles.
753 Defaults to `false`.
755 cola.tabwidth
756 -------------
757 The number of columns occupied by a tab character.  Defaults to 8.
759 cola.terminal
760 -------------
761 The command to use when launching commands within a graphical terminal.
763 `cola.terminal` defaults to `xterm -e` when unset.
764 e.g. when opening a shell, `git cola` will run `xterm -e $SHELL`.
766 `git cola` has built-in support for `xterm`, `gnome-terminal`, `konsole`.
767 If either `gnome-terminal`, `xfce4-terminal`, or `konsole` are installed
768 then they will be preferred over `xterm` when `cola.terminal` is unset.
770 The table below shows the built-in values that are used for the respective
771 terminal.  You can force the use of a specific terminal by configuring cola
772 accordingly.
774 cola.terminalshellquote
775 -----------------------
776 Some terminal require that the command string get passed as a string.
777 For example, ``xfce4-terminal -e "git difftool"`` requires shellquoting,
778 whereas ``gnome-terminal -- git difftool`` does not.
780 You should not need to set this variable for the built-in terminals
781 cola knows about -- it will behave correctly without configuration.
782 For example, when unconfigured, cola already knows that xfce4-terminal
783 requires shellquoting.
785 This configuration variable is for custom terminals outside of the builtin set.
786 The table below shows the builtin configuration.
788     Terminal            cola.terminal           cola.terminalshellquote
789     --------            -------------           -----------------------
790     gnome-terminal      gnome-terminal --       false
791     konsole             konsole -e              false
792     xfce4-terminal      xfce4-terminal -e       true
793     xterm               xterm -e                false
795 cola.textwidth
796 --------------
797 The number of columns used for line wrapping.
798 Tabs are counted according to `cola.tabwidth`.
800 .. _cola_theme:
802 cola.theme
803 ----------
804 Specifies the GUI theme to use throughout `git cola`. The theme specified
805 must be one of the following values:
807 * `default` â€“ default Qt theme, may appear different on various systems
808 * `flat-dark-blue`
809 * `flat-dark-green`
810 * `flat-dark-grey`
811 * `flat-dark-red`
812 * `flat-light-blue`
813 * `flat-light-green`
814 * `flat-light-grey`
815 * `flat-light-red`
817 If unset, or set to an invalid value, then the default style will be
818 used. The `default` theme is generated by Qt internal engine and should look
819 native but may look noticeably different on different platforms. The flat
820 themes on the other hand should look similar (but not identical) on various
821 systems.
823 The GUI theme can also be specified by passing ``--theme=<name>`` on the
824 command line.
826 cola.turbo
827 ----------
828 Set to `true` to enable "turbo" mode.  "Turbo" mode disables some
829 features that can slow things down when operating on huge repositories.
830 "Turbo" mode will skip loading Git commit messages, author details, status
831 information, and commit date details in the `File Browser` tool.
832 Defaults to `false`.
834 cola.color.text
835 ---------------
836 The default diff text color, in hexadecimal #RRGGBB notation.
837 Defaults to "#030303"::
839     git config cola.color.text '#030303'
841 cola.color.add
842 --------------
843 The default diff "add" background color, in hexadecimal #RRGGBB notation.
844 Defaults to "#d2ffe4"::
846     git config cola.color.add '#d2ffe4'
848 cola.color.remove
849 -----------------
850 The default diff "remove" background color, in hexadecimal #RRGGBB notation.
851 Defaults to "#fee0e4"::
853     git config cola.color.remove '#fee0e4'
855 cola.color.header
856 -----------------
857 The default diff header text color, in hexadecimal #RRGGBB notation.
858 Defaults to "#bbbbbb"::
860     git config cola.color.header '#bbbbbb'
862 core.hooksPath
863 --------------
864 Hooks are programs you can place in a hooks directory to trigger actions at
865 certain points in git’s execution. Hooks that don’t have the executable bit
866 set are ignored.
868 By default the hooks directory is ``$GIT_DIR/hooks``, but that can
869 be changed via the ``core.hooksPath`` configuration variable
871 The ``cola-prepare-commit-msg`` hook functionality and Cola's Git LFS
872 detection honors this configuration.
874 Please see the `git hooks documentation <https://git-scm.com/docs/githooks>`_
875 for more details.
877 gui.diffcontext
878 ---------------
879 The number of diff context lines to display.
881 gui.displayuntracked
882 --------------------
883 `git cola` avoids showing untracked files when set to `false`.
885 gui.editor
886 ----------
887 The default text editor to use is defined in `gui.editor`.
888 The config variable overrides the VISUAL environment variable.
889 e.g. `gvim -f -p`.
891 gui.historybrowser
892 ------------------
893 The history browser to use when visualizing history.
894 Defaults to `gitk`.
896 diff.tool
897 ---------
898 The default diff tool to use.
900 merge.tool
901 ----------
902 The default merge tool to use.
904 user.email
905 ----------
906 Your email address to be recorded in any newly created commits.
907 Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
908 'EMAIL' environment variables.
910 user.name
911 ---------
912 Your full name to be recorded in any newly created commits.
913 Can be overridden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'
914 environment variables.
916 ENVIRONMENT VARIABLES
917 =====================
919 GIT_COLA_ICON_THEME
920 -------------------
921 When set in the environment, `GIT_COLA_ICON_THEME` overrides the
922 theme specified in the `cola.icontheme` configuration.
923 Read :ref:`cola_icontheme` for more details.
925 GIT_COLA_SCALE
926 --------------
927 .. Important:: `GIT_COLA_SCALE` should not be used with newer versions of Qt.
929     Set `QT_AUTO_SCREEN_SCALE_FACTOR` to `1` and Qt will automatically
930     scale the interface to the correct size based on the display DPI.
931     This option is also available by setting `cola.hidpi` configuration.
933     See the `Qt High DPI documentation <https://doc.qt.io/qt-5/highdpi.html>`_
934     for more details.
936 `git cola` can be made to scale its interface for HiDPI displays.
937 When defined, `git cola` will scale icons, radioboxes, and checkboxes
938 according to the scale factor.  The default value is `1`.
939 A good value is `2` for high-resolution displays.
941 Fonts are not scaled, as their size can already be set in the settings.
943 GIT_COLA_TRACE
944 --------------
945 When defined, `git cola` logs `git` commands to stdout.
946 When set to `full`, `git cola` also logs the exit status and output.
947 When set to `trace`, `git cola` logs to the `Console` widget.
949 VISUAL
950 ------
951 Specifies the default editor to use.
952 This is ignored when the `gui.editor` configuration variable is defined.
954 LANGUAGE SETTINGS
955 =================
956 `git cola` automatically detects your language and presents some
957 translations when available.  This may not be desired, or you
958 may want `git cola` to use a specific language.
960 You can make `git cola` use an alternative language by creating a
961 `~/.config/git-cola/language` file containing the standard two-letter
962 gettext language code, e.g. "en", "de", "ja", "zh", etc.::
964     mkdir -p ~/.config/git-cola &&
965     echo en >~/.config/git-cola/language
967 Alternatively you may also use LANGUAGE environmental variable to temporarily
968 change `git cola`'s language just like any other gettext-based program.  For
969 example to temporarily change `git cola`'s language to English::
971     LANGUAGE=en git cola
973 To make `git cola` use the zh_TW translation with zh_HK, zh, and en as a
974 fallback.::
976     LANGUAGE=zh_TW:zh_HK:zh:en git cola
979 CUSTOM GUI ACTIONS
980 ==================
981 `git cola` allows you to define custom GUI actions by setting `git config`
982 variables.  The "name" of the command appears in the "Actions" menu.
984 guitool.<name>.cmd
985 ------------------
986 Specifies the shell command line to execute when the corresponding item of the
987 Tools menu is invoked. This option is mandatory for every tool. The command is
988 executed from the root of the working directory, and in the environment it
989 receives the name of the tool as GIT_GUITOOL, the name of the currently
990 selected file as FILENAME, and the name of the current branch as CUR_BRANCH
991 (if the head is detached, CUR_BRANCH is empty).
993 If ``<name>`` contains slashes (``/``) then the leading part of the name,
994 up until the final slash, is treated like a path of submenus under which the
995 actions will be created.
997 For example, configuring ``guitool.Commands/Util/echo.cmd`` creates a
998 ``Commands`` menu inside the top-level ``Actions`` menu, a ``Util`` menu
999 inside the ``Commands`` menu and an ``echo`` action inside the ``Commands``
1000 submenu.
1002 guitool.<name>.background
1003 -------------------------
1004 Run the command in the background (similar to editing and difftool actions).
1005 This avoids blocking the GUI.  Setting `background` to `true` implies
1006 `noconsole` and `norescan`.
1008 guitool.<name>.needsfile
1009 ------------------------
1010 Run the tool only if a diff is selected in the GUI. It guarantees that
1011 FILENAME is not empty.
1013 guitool.<name>.noconsole
1014 ------------------------
1015 Run the command silently, without creating a window to display its output.
1017 guitool.<name>.norescan
1018 -----------------------
1019 Don’t rescan the working directory for changes after the tool finishes
1020 execution.
1022 guitool.<name>.confirm
1023 ----------------------
1024 Show a confirmation dialog before actually running the tool.
1026 guitool.<name>.argprompt
1027 ------------------------
1028 Request a string argument from the user, and pass it to the tool through the
1029 ARGS environment variable. Since requesting an argument implies confirmation,
1030 the confirm option has no effect if this is enabled. If the option is set to
1031 true, yes, or 1, the dialog uses a built-in generic prompt; otherwise the
1032 exact value of the variable is used.
1034 guitool.<name>.revprompt
1035 ------------------------
1036 Request a single valid revision from the user, and set the REVISION
1037 environment variable. In other aspects this option is similar to argprompt,
1038 and can be used together with it.
1040 guitool.<name>.revunmerged
1041 --------------------------
1042 Show only unmerged branches in the revprompt subdialog. This is useful for
1043 tools similar to merge or rebase, but not for things like checkout or reset.
1045 guitool.<name>.title
1046 --------------------
1047 Specifies the title to use for the prompt dialog.
1048 Defaults to the tool name.
1050 guitool.<name>.prompt
1051 ---------------------
1052 Specifies the general prompt string to display at the top of the dialog,
1053 before subsections for argprompt and revprompt.
1054 The default value includes the actual command.
1056 guitool.<name>.shortcut
1057 -----------------------
1058 Specifies a keyboard shortcut for the custom tool.
1060 The value must be a valid string understood by the `QAction::setShortcut()` API.
1061 See http://qt-project.org/doc/qt-4.8/qkeysequence.html#QKeySequence-2
1062 for more details about the supported values.
1064 Avoid creating shortcuts that conflict with existing built-in `git cola`
1065 shortcuts.  Creating a conflict will result in no action when the shortcut
1066 is used.
1068 SETTING UP GPG FOR SIGNED COMMITS
1069 =================================
1070 When creating signed commits, `gpg` will attempt to read your password from the
1071 terminal from which `git cola` was launched.
1072 The way to make this work smoothly is to use a GPG agent so that you can avoid
1073 needing to re-enter your password every time you commit.
1075 This also gets you a graphical passphrase prompt instead of getting prompted
1076 for your password in the terminal.
1078 Install gpg-agent and friends
1079 -----------------------------
1080 On Mac OS X, you may need to `brew install gpg-agent` and install the
1081 `Mac GPG Suite <https://gpgtools.org/macgpg2/>`_.
1083 On Linux use your package manager to install gnupg2,
1084 gnupg-agent and pinentry-qt, e.g.::
1086     sudo apt-get install gnupg2 gnupg-agent pinentry-qt
1088 On Linux, you should also configure Git so that it uses gpg2 (gnupg2),
1089 otherwise you will get errors mentioning, "unable to open /dev/tty".
1090 Set Git's `gpg.program` to `gpg2`::
1092     git config --global gpg.program gpg2
1094 Configure gpg-agent and a pin-entry program
1095 -------------------------------------------
1096 On Mac OS X, edit `~/.gnupg/gpg.conf` to include the line,::
1098     use-agent
1100 This is typically not needed on Linux, where `gpg2` is used, as
1101 this is the default value when using `gpg2`.
1103 Next, edit `~/.gnupg/gpg-agent.conf` to contain a pinentry-program line
1104 pointing to the pinentry program for your platform.
1106 The following example `~/.gnupg/gpg-agent.conf` shows how to use
1107 pinentry-gtk-2 on Linux::
1109     pinentry-program /usr/bin/pinentry-gtk-2
1110     default-cache-ttl 3600
1112 This following example `.gnupg/gpg-agent.conf` shows how to use MacGPG2's
1113 pinentry app on On Mac OS X::
1115     pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
1116     default-cache-ttl 3600
1117     enable-ssh-support
1118     use-standard-socket
1120 Once this has been set up then you will need to reload your gpg-agent config::
1122     echo RELOADAGENT | gpg-connect-agent
1124 If you see the following output::
1126     OK
1128 Then the daemon is already running, and you do not need to start it yourself.
1130 If it is not running, eval the output of ``gpg-agent --daemon`` in your shell
1131 prior to launching `git cola`.::
1133     eval $(gpg-agent --daemon)
1134     git cola
1136 WINDOWS NOTES
1137 =============
1139 Git Installation
1140 ----------------
1141 If Git is installed in a custom location, e.g. not installed in `C:/Git` or
1142 Program Files, then the path to Git must be configured by creating a file in
1143 your home directory `~/.config/git-cola/git-bindir` that points to your git
1144 installation.  e.g.::
1146     C:/Tools/Git/bin
1148 SSH Agents for Key-based Authentication
1149 ---------------------------------------
1150 You may need to setup ssh-agent in order to use SSH key-based authentication
1151 on Windows. It has been reported that starting OpenSSH agent in
1152 Windows Services and adding the key using Powershell are necessary in order
1153 to get things working.
1155 Please see the following links for more details.
1157 https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows
1159 FIPS Security Mode
1160 ==================
1161 `FIPS Security Mode <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation>`_
1162 is available in newer versions of Python. These include Python 3.9+ and the
1163 patched Python 3.6 used by CentOS8/RHEL8 (and possibly others).
1165 Git Cola uses the ``hashlib.md5`` function and adheres to the FIPS security
1166 mode when available. Git Cola does not use the MD5 value for security purposes.
1167 MD% is used only for the purposes of implementing the ``cola/gravatar.py``
1168 Gravatar client.
1170 LINKS
1171 =====
1173 Git Cola's Git Repository
1174 -------------------------
1175 https://github.com/git-cola/git-cola/
1177 Git Cola Homepage
1178 -----------------
1179 https://git-cola.github.io/
1181 Mailing List
1182 ------------
1183 https://groups.google.com/group/git-cola