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