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