git-cola v4.0.2
[git-cola.git] / docs / git-cola.rst
blob3fa103302877a692cbf6c4e343a0fe88529e2b1c
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 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 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 environment variable::
515     # Override the default theme to adwaita-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 shell quoting,
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 shell quoting.
785 This configuration variable is for custom terminals outside of the builtin set.
786 The table below shows the builtin configuration.
788 =================== ======================= =============================
789 Terminal            ``cola.terminal``       ``cola.terminalshellquote``
790 =================== ======================= =============================
791 gnome-terminal      ``gnome-terminal --``   ``false``
792 konsole             ``konsole -e``          ``false``
793 xfce4-terminal      ``xfce4-terminal -e``   ``true``
794 xterm               ``xterm -e``            ``false``
795 =================== ======================= =============================
797 cola.textwidth
798 --------------
799 The number of columns used for line wrapping.
800 Tabs are counted according to `cola.tabwidth`.
802 .. _cola_theme:
804 cola.theme
805 ----------
806 Specifies the GUI theme to use throughout `git cola`. The theme specified
807 must be one of the following values:
809 * `default` â€“ default Qt theme, may appear different on various systems
810 * `flat-dark-blue`
811 * `flat-dark-green`
812 * `flat-dark-grey`
813 * `flat-dark-red`
814 * `flat-light-blue`
815 * `flat-light-green`
816 * `flat-light-grey`
817 * `flat-light-red`
819 If unset, or set to an invalid value, then the default style will be
820 used. The `default` theme is generated by Qt internal engine and should look
821 native but may look noticeably different on different platforms. The flat
822 themes on the other hand should look similar (but not identical) on various
823 systems.
825 The GUI theme can also be specified by passing ``--theme=<name>`` on the
826 command line.
828 cola.turbo
829 ----------
830 Set to `true` to enable "turbo" mode.  "Turbo" mode disables some
831 features that can slow things down when operating on huge repositories.
832 "Turbo" mode will skip loading Git commit messages, author details, status
833 information, and commit date details in the `File Browser` tool.
834 Defaults to `false`.
836 cola.color.text
837 ---------------
838 The default diff text color, in hexadecimal #RRGGBB notation.
839 Defaults to "#030303"::
841     git config cola.color.text '#030303'
843 cola.color.add
844 --------------
845 The default diff "add" background color, in hexadecimal #RRGGBB notation.
846 Defaults to "#d2ffe4"::
848     git config cola.color.add '#d2ffe4'
850 cola.color.remove
851 -----------------
852 The default diff "remove" background color, in hexadecimal #RRGGBB notation.
853 Defaults to "#fee0e4"::
855     git config cola.color.remove '#fee0e4'
857 cola.color.header
858 -----------------
859 The default diff header text color, in hexadecimal #RRGGBB notation.
860 Defaults to "#bbbbbb"::
862     git config cola.color.header '#bbbbbb'
864 core.hooksPath
865 --------------
866 Hooks are programs you can place in a hooks directory to trigger actions at
867 certain points in git’s execution. Hooks that don’t have the executable bit
868 set are ignored.
870 By default the hooks directory is ``$GIT_DIR/hooks``, but that can
871 be changed via the ``core.hooksPath`` configuration variable
873 The ``cola-prepare-commit-msg`` hook functionality and Cola's Git LFS
874 detection honors this configuration.
876 Please see the `git hooks documentation <https://git-scm.com/docs/githooks>`_
877 for more details.
879 gui.diffcontext
880 ---------------
881 The number of diff context lines to display.
883 gui.displayuntracked
884 --------------------
885 `git cola` avoids showing untracked files when set to `false`.
887 gui.editor
888 ----------
889 The default text editor to use is defined in `gui.editor`.
890 The config variable overrides the VISUAL environment variable.
891 e.g. `gvim -f -p`.
893 gui.historybrowser
894 ------------------
895 The history browser to use when visualizing history.
896 Defaults to `gitk`.
898 diff.tool
899 ---------
900 The default diff tool to use.
902 merge.tool
903 ----------
904 The default merge tool to use.
906 user.email
907 ----------
908 Your email address to be recorded in any newly created commits.
909 Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
910 'EMAIL' environment variables.
912 user.name
913 ---------
914 Your full name to be recorded in any newly created commits.
915 Can be overridden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'
916 environment variables.
918 ENVIRONMENT VARIABLES
919 =====================
921 GIT_COLA_ICON_THEME
922 -------------------
923 When set in the environment, `GIT_COLA_ICON_THEME` overrides the
924 theme specified in the `cola.icontheme` configuration.
925 Read :ref:`cola_icontheme` for more details.
927 GIT_COLA_SCALE
928 --------------
929 .. Important:: `GIT_COLA_SCALE` should not be used with newer versions of Qt.
931     Set `QT_AUTO_SCREEN_SCALE_FACTOR` to `1` and Qt will automatically
932     scale the interface to the correct size based on the display DPI.
933     This option is also available by setting `cola.hidpi` configuration.
935     See the `Qt High DPI documentation <https://doc.qt.io/qt-5/highdpi.html>`_
936     for more details.
938 `git cola` can be made to scale its interface for HiDPI displays.
939 When defined, `git cola` will scale icons, radioboxes, and checkboxes
940 according to the scale factor.  The default value is `1`.
941 A good value is `2` for high-resolution displays.
943 Fonts are not scaled, as their size can already be set in the settings.
945 GIT_COLA_TRACE
946 --------------
947 When defined, `git cola` logs `git` commands to stdout.
948 When set to `full`, `git cola` also logs the exit status and output.
949 When set to `trace`, `git cola` logs to the `Console` widget.
951 VISUAL
952 ------
953 Specifies the default editor to use.
954 This is ignored when the `gui.editor` configuration variable is defined.
956 LANGUAGE SETTINGS
957 =================
958 `git cola` automatically detects your language and presents some
959 translations when available.  This may not be desired, or you
960 may want `git cola` to use a specific language.
962 You can make `git cola` use an alternative language by creating a
963 `~/.config/git-cola/language` file containing the standard two-letter
964 gettext language code, e.g. "en", "de", "ja", "zh", etc.::
966     mkdir -p ~/.config/git-cola &&
967     echo en >~/.config/git-cola/language
969 Alternatively you may also use LANGUAGE environmental variable to temporarily
970 change `git cola`'s language just like any other gettext-based program.  For
971 example to temporarily change `git cola`'s language to English::
973     LANGUAGE=en git cola
975 To make `git cola` use the zh_TW translation with zh_HK, zh, and en as a
976 fallback.::
978     LANGUAGE=zh_TW:zh_HK:zh:en git cola
981 CUSTOM GUI ACTIONS
982 ==================
983 `git cola` allows you to define custom GUI actions by setting `git config`
984 variables.  The "name" of the command appears in the "Actions" menu.
986 guitool.<name>.cmd
987 ------------------
988 Specifies the shell command line to execute when the corresponding item of the
989 Tools menu is invoked. This option is mandatory for every tool. The command is
990 executed from the root of the working directory, and in the environment it
991 receives the name of the tool as GIT_GUITOOL, the name of the currently
992 selected file as FILENAME, and the name of the current branch as CUR_BRANCH
993 (if the head is detached, CUR_BRANCH is empty).
995 If ``<name>`` contains slashes (``/``) then the leading part of the name,
996 up until the final slash, is treated like a path of submenus under which the
997 actions will be created.
999 For example, configuring ``guitool.Commands/Util/echo.cmd`` creates a
1000 ``Commands`` menu inside the top-level ``Actions`` menu, a ``Util`` menu
1001 inside the ``Commands`` menu and an ``echo`` action inside the ``Commands``
1002 submenu.
1004 guitool.<name>.background
1005 -------------------------
1006 Run the command in the background (similar to editing and difftool actions).
1007 This avoids blocking the GUI.  Setting `background` to `true` implies
1008 `noconsole` and `norescan`.
1010 guitool.<name>.needsfile
1011 ------------------------
1012 Run the tool only if a diff is selected in the GUI. It guarantees that
1013 FILENAME is not empty.
1015 guitool.<name>.noconsole
1016 ------------------------
1017 Run the command silently, without creating a window to display its output.
1019 guitool.<name>.norescan
1020 -----------------------
1021 Don’t rescan the working directory for changes after the tool finishes
1022 execution.
1024 guitool.<name>.confirm
1025 ----------------------
1026 Show a confirmation dialog before actually running the tool.
1028 guitool.<name>.argprompt
1029 ------------------------
1030 Request a string argument from the user, and pass it to the tool through the
1031 ARGS environment variable. Since requesting an argument implies confirmation,
1032 the confirm option has no effect if this is enabled. If the option is set to
1033 true, yes, or 1, the dialog uses a built-in generic prompt; otherwise the
1034 exact value of the variable is used.
1036 guitool.<name>.revprompt
1037 ------------------------
1038 Request a single valid revision from the user, and set the REVISION
1039 environment variable. In other aspects this option is similar to argprompt,
1040 and can be used together with it.
1042 guitool.<name>.revunmerged
1043 --------------------------
1044 Show only unmerged branches in the revprompt subdialog. This is useful for
1045 tools similar to merge or rebase, but not for things like checkout or reset.
1047 guitool.<name>.title
1048 --------------------
1049 Specifies the title to use for the prompt dialog.
1050 Defaults to the tool name.
1052 guitool.<name>.prompt
1053 ---------------------
1054 Specifies the general prompt string to display at the top of the dialog,
1055 before subsections for argprompt and revprompt.
1056 The default value includes the actual command.
1058 guitool.<name>.shortcut
1059 -----------------------
1060 Specifies a keyboard shortcut for the custom tool.
1062 The value must be a valid string understood by the `QAction::setShortcut()` API.
1063 See http://qt-project.org/doc/qt-4.8/qkeysequence.html#QKeySequence-2
1064 for more details about the supported values.
1066 Avoid creating shortcuts that conflict with existing built-in `git cola`
1067 shortcuts.  Creating a conflict will result in no action when the shortcut
1068 is used.
1070 SETTING UP GPG FOR SIGNED COMMITS
1071 =================================
1072 When creating signed commits, `gpg` will attempt to read your password from the
1073 terminal from which `git cola` was launched.
1074 The way to make this work smoothly is to use a GPG agent so that you can avoid
1075 needing to re-enter your password every time you commit.
1077 This also gets you a graphical passphrase prompt instead of getting prompted
1078 for your password in the terminal.
1080 Install gpg-agent and friends
1081 -----------------------------
1082 On Mac OS X, you may need to `brew install gpg-agent` and install the
1083 `Mac GPG Suite <https://gpgtools.org/macgpg2/>`_.
1085 On Linux use your package manager to install gnupg2,
1086 gnupg-agent and pinentry-qt, e.g.::
1088     sudo apt-get install gnupg2 gnupg-agent pinentry-qt
1090 On Linux, you should also configure Git so that it uses gpg2 (gnupg2),
1091 otherwise you will get errors mentioning, "unable to open /dev/tty".
1092 Set Git's `gpg.program` to `gpg2`::
1094     git config --global gpg.program gpg2
1096 Configure gpg-agent and a pin-entry program
1097 -------------------------------------------
1098 On Mac OS X, edit `~/.gnupg/gpg.conf` to include the line,::
1100     use-agent
1102 This is typically not needed on Linux, where `gpg2` is used, as
1103 this is the default value when using `gpg2`.
1105 Next, edit `~/.gnupg/gpg-agent.conf` to contain a pinentry-program line
1106 pointing to the pinentry program for your platform.
1108 The following example `~/.gnupg/gpg-agent.conf` shows how to use
1109 pinentry-gtk-2 on Linux::
1111     pinentry-program /usr/bin/pinentry-gtk-2
1112     default-cache-ttl 3600
1114 This following example `.gnupg/gpg-agent.conf` shows how to use MacGPG2's
1115 pinentry app on On Mac OS X::
1117     pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
1118     default-cache-ttl 3600
1119     enable-ssh-support
1120     use-standard-socket
1122 Once this has been set up then you will need to reload your gpg-agent config::
1124     echo RELOADAGENT | gpg-connect-agent
1126 If you see the following output::
1128     OK
1130 Then the daemon is already running, and you do not need to start it yourself.
1132 If it is not running, eval the output of ``gpg-agent --daemon`` in your shell
1133 prior to launching `git cola`.::
1135     eval $(gpg-agent --daemon)
1136     git cola
1138 WINDOWS NOTES
1139 =============
1141 Git Installation
1142 ----------------
1143 If Git is installed in a custom location, e.g. not installed in `C:/Git` or
1144 Program Files, then the path to Git must be configured by creating a file in
1145 your home directory `~/.config/git-cola/git-bindir` that points to your git
1146 installation.  e.g.::
1148     C:/Tools/Git/bin
1150 SSH Agents for Key-based Authentication
1151 ---------------------------------------
1152 You may need to setup ssh-agent in order to use SSH key-based authentication
1153 on Windows. It has been reported that starting OpenSSH agent in
1154 Windows Services and adding the key using Powershell are necessary in order
1155 to get things working.
1157 Please see the following links for more details.
1159 https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows
1161 FIPS Security Mode
1162 ==================
1163 `FIPS Security Mode <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation>`_
1164 is available in newer versions of Python. These include Python 3.9+ and the
1165 patched Python 3.6 used by CentOS8/RHEL8 (and possibly others).
1167 Git Cola uses the ``hashlib.md5`` function and adheres to the FIPS security
1168 mode when available. Git Cola does not use the MD5 value for security purposes.
1169 MD% is used only for the purposes of implementing the ``cola/gravatar.py``
1170 Gravatar client.
1172 LINKS
1173 =====
1175 Git Cola's Git Repository
1176 -------------------------
1177 https://github.com/git-cola/git-cola/
1179 Git Cola Homepage
1180 -----------------
1181 https://git-cola.github.io/
1183 Mailing List
1184 ------------
1185 https://groups.google.com/group/git-cola