package
🔄 Redistribution of Git for Windows PortableGit
npm install portablegitGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Latest published Jun 22, 2024
latest
next
🔄 Redistribution of Git for Windows' PortableGit via npm
|
🔶 Use Git for Windows via npm
👨💻 Provides bash via Git Bash
💾 Uses a portable installation of Git & friends
🟦 Only works on Windows x64
🛑 Only works on Windows x64 systems. Does not work on macOS or Linux.
You can install this package using npm or your favorite npm package manager. If possible you should use the user or global Git for Windows installation instead of this package.
npm install --save-dev portablegitThis package has a postinstall script
⚠️ It's not recommended to install this package globally! Install Git for Windows normally on your system instead. Interested in installing Git globally on more that just Windows machines? Check out Git - Installing Git.
ℹ There is no JavaScript component to this package; it's just a redistribution of the PortableGit files and binaries.
You can use this package just as you would any other npm package that provides binaries! PortableGit only provides binaries for Windows.
npx -p portablegit git --version
#=> git version 2.X.Y.windows.ZAvailable binary commands exposed through this npm package are:
bash: Git Bash bash.exe. Useful for cross-platform scripting. You can run Bash scripts on Windows!sh: Git Bash sh.exe. Runs bash.exe in POSIX mode.git: The actual git.exe binary for Windows. See the Git website to learn more about Git.git-bash: Launches a terminal emulator running Git Bash. Uses MinTTY.git-cmd: Starts a cmd.exe subshell preloaded with git.exe and other things in $PATH. Does not launch a new window.git-gui: Starts the Git GUI.gitk: Starts the GitK GUI.This portablegit npm package is versioned to follow Git for Windows releases. For example, Git for Windows v2.45.1.windows.1 (derived from Git 2.45.1) would be released as portablegit@2.45.11 on npm. Note that there's a 1 suffix appended to the version number. Git for Windows v2.45.1.windows.2 would then be released as portablegit@2.45.12 on npm. The suffix is now a 2 just like .windows.2. For X.Y.0.windows.1 releases the npm-ified X.Y.01 version specifier is invalid; we need to drop the leading zero to create an X.Y.1 release.
You can import.meta.resolve() or require.resolve() anything that would normally be in the extracted PortableGit/* folder. Here's an example:
const cat = import.meta.resolve("portablegit/usr/bin/cat");
console.log(cat);
//=> 'file:///C:/myproject/node_modules/portablegit/out/portablegit/usr/bin/cat'
const cut = require.resolve("portablegit/usr/bin/cut");
console.log(cut);
//=> 'C:\\myproject\\node_modules\\portablegit\\out\\portablegit\\usr\\bin\\cut'This can be useful if you need to resolve the path to a specific binary (cat.exe, cut.exe, etc.) that isn't exposed by default.
npm run build to make sure everything looks good locally.npm run generate redownloads the configured version of Git for Windows PortableGit as a 7zip self-extracting archive.X.Y.Z-rc.N.version field in package.json and the constants in scripts.js generate().npm run build currently has a system dependency on the 7z command. You can install 7zip from 7-zip.org.Steps to release:
package.json to the new version RC like 2.45.21-rc.1.scripts.js generate() to the new version tag like 2.45.2.windows.1.scripts.js generate() to the new version tag like PortableGit-2.45.2-64-bit.7z.exe.npm run generate to vendor the new version.npm run build and npm test to make sure everything works. Check that git --version matches the new version.v2.45.21-rc.1 tag.next 2.45.21-rc.1 version to npm.npx -p portablegit@next git --version or similar.package.json to the new version like 2.45.21.v2.45.21 tag.latest 2.45.21 version to npm.TL;DR: Do a prelease -rc.1 first to make sure things work before doing the actual release. This lets us mirror the Git for Windows version numbers without a special suffix if we get things wrong.
tig, start-ssh-agent, start-ssh-pagent, scalar, git-receive-pack git-upload-pack: Extra things that I'm not not smart enough to understand.Estimated unpacked size across 18 packages.
386.0 MB
Includes dependencies.