FarNet.GitKit
0.7.3
Prefix Reserved
See the version list below for details.
dotnet add package FarNet.GitKit --version 0.7.3
NuGet\Install-Package FarNet.GitKit -Version 0.7.3
<PackageReference Include="FarNet.GitKit" Version="0.7.3" />
paket add FarNet.GitKit --version 0.7.3
#r "nuget: FarNet.GitKit, 0.7.3"
// Install FarNet.GitKit as a Cake Addin #addin nuget:?package=FarNet.GitKit&version=0.7.3 // Install FarNet.GitKit as a Cake Tool #tool nuget:?package=FarNet.GitKit&version=0.7.3
FarNet.GitKit
Far Manager git helpers based on LibGit2Sharp
About
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
- Wiki: https://github.com/nightroman/FarNet/wiki
- Site: https://github.com/nightroman/FarNet
- Author: Roman Kuzmin
Install
- Far Manager
- Package FarNet
- Package FarNet.GitKit
- Optional package FarNet.PowerShellFar
How to install and update FarNet and modules
https://github.com/nightroman/FarNet#readme
Commands
GitKit commands use the prefix gk
. Commands may be typed and invoked in the
Far Manager command line or using F11 / FarNet / Invoke. Commands may be also
defined in the Far Manager user menu and file associations.
The command gk:
without subcommand prints the repository status. Some
commands require parameters, one or more key=value pairs separated by
semicolons, using the connection string format.
gk:subcommand [key=value] [; key=value] ...
Common parameters
Repo=<path>
Specifies the existing repository path. Default: the current panel directory.
Panel commands
gk:branches
Opens the Branches panel.
gk:commits
Opens the Commits panel.
gk:changes
Opens the Changes panel.
Operation commands
gk:init
Creates repository, see Init command.
gk:clone
Clones repository, see Clone command.
gk:commit
Commits changes, see Commit command.
gk:checkout
Checkouts branch, see Checkout command.
gk:pull
Pulls the head branch, see Pull command.
gk:push
Pushes the head branch, see Push command.
gk:
Prints the repository status: summary of changes if any, the commit hash, local and remote branches with the same tip commit, the commit message.
Init command
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={true|false}
Tells to create a bare repository.
Clone command
Use this command in order to clone a repository
gk:clone
Parameters
Url=<string>
(required)Specifies the source repository URL.
Path=<string>
Specifies the local path to clone into. Default: the current panel directory.
IsBare={true|false}
Tells to clone a bare repository.
NoCheckout={true|false}
Tells not to checkout after cloning.
RecurseSubmodules={true|false}
Tells to recursively clone submodules.
Commit command
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={true|false}
Tells to stage all changes before committing.
AllowEmptyCommit={true|false}
Tells to allow creation of an empty commit.
AmendPreviousCommit={true|false}
Tells to amend the previous commit.
PrettifyMessage={true|false}
Tells to prettify the message by stripping leading and trailing empty lines, trailing spaces, and collapsing consecutive empty lines.
PrettifyMessage
is ignored ifCommentaryChar
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
impliesPrettifyMessage=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
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
Use this command in order to pull the head branch
gk:pull
Push command
Use this command in order to push the head branch, with a confirmation dialog
gk:push
Panels
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
This panel shows the repository branches, local and remote.
Branch marks: *
head, r
remote, =
tracked same as remote, <
tracked older, >
tracked newer.
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, useShiftF5
.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.
Other keys
See Panels for common keys and actions.
Other actions
See Menu.
Commits panel
This panel shows branch commits. Commits are shown by pages of CommitsPageLimit
, see Settings.
The panel is opened from the branches panel or for the head branch by
gk:commits
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.
Other keys
See Panels for common keys and actions.
Other actions
See Menu.
Changes panel
This panel shows changed files.
The panel is opened from the commits panel or by the menu commands "Compare branches" and "Compare commits" or for the current changes by
gk: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.
Other keys
See Panels for common keys and actions.
Menu
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.
Help
Shows GitKit help.
Settings
The module settings: F11 / FarNet / Settings / GitKit.
DiffTool and DiffToolArguments
Specify the diff tool and its 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
Remote git operations require credentials, git host user name and password. GitKit offers two ways, with some advantages and disadvantages.
By default, see Settings, with UseGitCredentials
set to false,
the input dialog is used. For the given git host, enter the 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.
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.0.3 | 88 | 10/26/2024 |
1.0.2 | 216 | 4/20/2024 |
1.0.1 | 243 | 1/13/2024 |
1.0.0 | 243 | 11/19/2023 |
0.9.7 | 295 | 11/1/2023 |
0.9.6 | 217 | 10/27/2023 |
0.9.5 | 230 | 10/26/2023 |
0.9.4 | 235 | 10/25/2023 |
0.9.3 | 257 | 5/16/2023 |
0.9.2 | 160 | 5/3/2023 |
0.9.1 | 149 | 5/2/2023 |
0.9.0 | 168 | 5/1/2023 |
0.8.6 | 162 | 4/30/2023 |
0.8.5 | 162 | 4/29/2023 |
0.8.4 | 164 | 4/28/2023 |
0.8.3 | 171 | 4/27/2023 |
0.8.2 | 160 | 4/27/2023 |
0.8.1 | 163 | 4/26/2023 |
0.8.0 | 158 | 4/26/2023 |
0.7.8 | 175 | 4/24/2023 |
0.7.7 | 171 | 4/23/2023 |
0.7.6 | 182 | 4/23/2023 |
0.7.5 | 179 | 4/23/2023 |
0.7.4 | 163 | 4/21/2023 |
0.7.3 | 176 | 4/21/2023 |
0.7.2 | 181 | 4/21/2023 |
0.7.1 | 187 | 4/19/2023 |
0.7.0 | 183 | 4/19/2023 |
0.6.5 | 211 | 4/18/2023 |
0.6.4 | 166 | 4/18/2023 |
0.6.3 | 175 | 4/18/2023 |
0.6.2 | 185 | 4/17/2023 |
0.6.1 | 184 | 4/16/2023 |
0.6.0 | 187 | 4/16/2023 |
0.5.3 | 192 | 4/15/2023 |
0.5.2 | 191 | 4/15/2023 |
0.5.1 | 180 | 4/15/2023 |
0.5.0 | 194 | 4/14/2023 |
0.4.0 | 195 | 4/13/2023 |
0.3.2 | 190 | 4/12/2023 |
0.3.1 | 194 | 4/12/2023 |
0.3.0 | 189 | 4/12/2023 |
0.2.4 | 179 | 4/11/2023 |
0.2.3 | 198 | 4/11/2023 |
0.2.2 | 191 | 4/11/2023 |
0.2.1 | 186 | 4/11/2023 |
0.2.0 | 187 | 4/11/2023 |
0.1.0 | 196 | 4/10/2023 |
0.0.3 | 192 | 4/9/2023 |
0.0.2 | 192 | 4/9/2023 |
0.0.1 | 183 | 4/8/2023 |