FarNet.GitKit 0.9.5

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package FarNet.GitKit --version 0.9.5                
NuGet\Install-Package FarNet.GitKit -Version 0.9.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FarNet.GitKit" Version="0.9.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FarNet.GitKit --version 0.9.5                
#r "nuget: FarNet.GitKit, 0.9.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FarNet.GitKit as a Cake Addin
#addin nuget:?package=FarNet.GitKit&version=0.9.5

// Install FarNet.GitKit as a Cake Tool
#tool nuget:?package=FarNet.GitKit&version=0.9.5                

FarNet.GitKit

Far Manager git helpers based on LibGit2Sharp


About

Contents

GitKit is the FarNet module for git operations in Far Manager. GitKit uses LibGit2Sharp and git is not needed as such. Git may be optionally used for getting credentials.

Project FarNet


Install

Contents

How to install and update FarNet and modules
https://github.com/nightroman/FarNet#readme


Commands

Contents

GitKit commands start with gk:. Commands are invoked in the command line or using F11 / FarNet / Invoke or defined in the user menu and file associations. Command parameters are key=value pairs separated by semicolons, using the connection string format

gk:subcommand [key=value] [; key=value] ...

If you have nothing or spaces after gk: then this help topic is shown.

Common parameters

  • Repo=<path>

    Specifies the existing repository path.
    Default: the current panel directory.

Panel commands

Operation commands


cd command

Contents

Use this command to navigate to a repository directory or file

gk:cd

Parameters

  • Path=<string>

    Specifies the repository path relative to the root.
    Default: the repository root.

    If the path specifies an existing file then the command navigates to its directory panel and sets the cursor to this file.


Edit command

Contents

Use this command to edit the specified repository file

gk:edit

Parameters

  • Path=<string>

    Specifies the repository file path relative to the root.
    Default: you are prompted to enter.

    Examples

    • README.md - the root README.md
    • .git\config - the local configuration file
    • .git\COMMIT_EDITMSG - the last edited commit message

Init command

Contents

Use this command in order to create a repository

gk:init

Parameters

  • Path=<string>

    Specifies the new repository directory.
    Default: the current panel directory.

  • IsBare=<bool>

    Tells to create a bare repository.


Clone command

Contents

Use this command in order to clone a repository

gk:clone

Parameters

  • Url=<string> (required)

    Specifies the remote repository.

  • Path=<string>

    Specifies the local path to clone into.
    Default: the current panel directory.

  • IsBare=<bool>

    Tells to clone a bare repository.

  • NoCheckout=<bool>

    Tells not to checkout after cloning.

  • RecurseSubmodules=<bool>

    Tells to recursively clone submodules.


Commit command

Contents

Use this command in order to commit changes

gk:commit

Parameters

  • Message=<string>

    The commit message. Omit it in order to compose in the editor. If you also set CommentaryChar then the editor text will contain commentaries about changes.

  • All=<bool>

    Tells to stage all changes before committing.

  • AllowEmptyCommit=<bool>

    Tells to allow creation of an empty commit.

  • AmendPreviousCommit=<bool>

    Tells to amend the previous commit.

  • PrettifyMessage=<bool>

    Tells to prettify the message by stripping leading and trailing empty lines, trailing spaces, and collapsing consecutive empty lines. PrettifyMessage is ignored if CommentaryChar is set.

  • CommentaryChar=<char>

    The starting line char used to identify commentaries in the commit message. If set (usually to "#"), all lines starting with this char will be removed. CommentaryChar implies PrettifyMessage=true.

Examples

# commit all changes, compose a new message in the editor
gk:commit All=true; CommentaryChar=#

# amend with all changes, modify the old message in the editor
gk:commit All=true; CommentaryChar=#; AmendPreviousCommit=true

Checkout command

Contents

Use this command in order to checkout the specified branch

gk:checkout

Parameters

  • Branch=<string>

    The branch to checkout. If it is omitted you are prompted to input the branch name.

    If the specified branch does not exists, it is created from the head branch, with a confirmation dialog.


Pull command

Contents

Use this command in order to pull the head branch

gk:pull

Push command

Contents

Use this command in order to push the head branch, with a confirmation dialog

gk:push

Blame command

Contents

Use this command in order to view the specified file line commits in the editor

gk:blame

Parameters

  • Path=<string>

    Specifies the file to blame. For the cursor file omit the parameter or use "?".

  • IsGitPath=<bool>

    Tells to treat Path as git path.

Keys and actions

  • Enter

    Opens the changes panel for the caret line commit.


Status command

Contents

Use this command in order to print the repository status information like change summary, commit hash, head branch, similar branches, commit message

gk:status

Parameters

  • ShowFiles=<bool>

    Tells to print changed file statuses and paths before the summary line.


Panels

Contents

GitKit provides several panels for browsing and operating

Common panel keys and actions

  • CtrlA

    Opens the cursor item property panel. This operation requires FarNet.PowerShellFar.


Branches panel

Contents

This panel shows the repository branches, local and remote. Branch marks: * head, r remote, = tracked same as remote, < tracked older, > tracked newer, ? tracked orphan.

The panel is opened by

gk:branches

Keys and actions

  • Enter

    Opens the cursor branch Commits panel.

  • ShiftEnter

    Checkouts the cursor branch. For the local branch, makes it the head branch. For the remote branch, creates a new branch from it and makes it the head branch.

  • ShiftF5

    Creates a new branch from the cursor branch.

  • ShiftF6

    Renames the cursor branch.

  • F7

    Creates and checkouts a new branch from the head branch. Note that the head branch is with *, not the cursor. To copy the cursor branch, use ShiftF5.

  • F8, Del

    Safely deletes the selected local branches.

    Branches with unique local commits and remote branches are not deleted. Use ShiftF8, ShiftDel in order to force delete them.

  • ShiftF8, ShiftDel

    Forcedly deletes the selected local and remote branches.

  • See also Panels and Menu.


Commits panel

Contents

This panel shows branch or path commits. Commits are shown by pages of CommitsPageLimit, see Settings.

The panel is opened from the branches panel or by the command

gk:commits

Parameters

  • Path=<string>

    Tells to show commits including the specified file system or git path. Use "?" for the panel cursor file or directory.

    When Path is omitted, the head branch commits are shown.

  • IsGitPath=<bool>

    Tells to treat Path as git path.

Keys and actions

  • Enter

    Opens the cursor commit Changes panel.

  • PgDn

    At the last shown commit, loads the next page commits.

  • PgUp

    At the first shown commit, loads the previous page commits.

  • See also Panels and Menu.


Changes panel

Contents

This panel shows changed files.

The panel is opened from the commits panel or by the menu commands "Compare branches" and "Compare commits" or by the command

gk:changes

Parameters

  • Kind=<enum>

    Specifies the changes kind

    • NotCommitted: includes all not committed changes, i.e. NotStaged and Staged
    • NotStaged: not staged changes (git working directory)
    • Staged: staged changes (git index)
    • Head: last committed changes
    • Last: (default) NotCommitted changes if any, or else Head changes

Keys and actions

  • Enter

    Opens the diff tool specified by the setting DiffTool.

  • F3, F4

    Opens the diff patch in the viewer or editor.

  • See also Panels and Menu.


Contents

  • Push branch (branches panel, commits panel)

    Branches panel: Pushes the cursor branch, with a confirmation dialog.

    Commits panel: Pushes the commits branch, with a confirmation dialog.

  • Merge branch (branches panel)

    Merges the cursor branch into the head branch, with a confirmation dialog.

  • Compare branches (branches panel)

    Compares the cursor branch with the selected branch and opens the changes panel. If nothing is selected then the head branch is used.

  • Create branch (commits panel)

    Creates a new branch from the cursor commit.

  • Compare commits (commits panel)

    Compares the cursor commit with the selected commit and opens the changes panel. If nothing is selected then the tip commit is used.

  • Commit log

    Opens the panel with commits including the cursor file or directory path.

  • Edit file (changes panel)

    If the cursor change file exists, opens this file in the editor.

  • Help

    Shows GitKit help.


Settings

Contents

Settings editor: F11 / FarNet / Settings / GitKit


DiffTool and DiffToolArguments

Specify the diff tool and arguments used to compare changed files. In arguments use %1 and %2 as file path substitutes. Environment variables are expanded.

VSCode is used as the default diff tool

%LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd
--wait --diff "%1" "%2"

UseGitCredentials

If true, tells to use git credentials for remote tasks. See Credentials for details.
Default: false.


CommitsPageLimit

Maximum number of commits per panel pages.
Default: 100.


ShaPrefixLength

The number of chars for truncated commit SHA.
Default: 7.


Credentials

Contents Settings

Remote git hosts may require credentials, user name and password. GitKit offers two ways, with some advantages and disadvantages.

With UseGitCredentials set to false, an input dialog is used. Enter user name and password and optionally save them for later use. The environment variable GitKit_User is used for keeping credentials.

Alternatively, if you have git installed and available in the path, set UseGitCredentials to true in order to use git for getting credentials.


There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 24 12/4/2024
1.0.3 95 10/26/2024
1.0.2 218 4/20/2024
1.0.1 245 1/13/2024
1.0.0 245 11/19/2023
0.9.7 297 11/1/2023
0.9.6 219 10/27/2023
0.9.5 232 10/26/2023
0.9.4 237 10/25/2023
0.9.3 259 5/16/2023
0.9.2 162 5/3/2023
0.9.1 151 5/2/2023
0.9.0 170 5/1/2023
0.8.6 164 4/30/2023
0.8.5 164 4/29/2023
0.8.4 166 4/28/2023
0.8.3 175 4/27/2023
0.8.2 162 4/27/2023
0.8.1 165 4/26/2023
0.8.0 160 4/26/2023
0.7.8 177 4/24/2023
0.7.7 173 4/23/2023
0.7.6 184 4/23/2023
0.7.5 181 4/23/2023
0.7.4 165 4/21/2023
0.7.3 178 4/21/2023
0.7.2 183 4/21/2023
0.7.1 189 4/19/2023
0.7.0 185 4/19/2023
0.6.5 213 4/18/2023
0.6.4 168 4/18/2023
0.6.3 177 4/18/2023
0.6.2 187 4/17/2023
0.6.1 186 4/16/2023
0.6.0 189 4/16/2023
0.5.3 194 4/15/2023
0.5.2 193 4/15/2023
0.5.1 182 4/15/2023
0.5.0 196 4/14/2023
0.4.0 197 4/13/2023
0.3.2 192 4/12/2023
0.3.1 196 4/12/2023
0.3.0 191 4/12/2023
0.2.4 181 4/11/2023
0.2.3 200 4/11/2023
0.2.2 193 4/11/2023
0.2.1 188 4/11/2023
0.2.0 189 4/11/2023
0.1.0 198 4/10/2023
0.0.3 194 4/9/2023
0.0.2 194 4/9/2023
0.0.1 185 4/8/2023