3

I am looking for something that I can use for working with git repositories on windows that is 100% portable (copy-paste the files to a separate machine and have it work) and CLI based - I had a version of git bash that met these requirements previously, but I can't find it anymore and it is now an older version that doesn't support newer, useful features.

Any suggestions?

2 Answers 2

1

I also used the portable Git bash until recently. I now use Magit. It's an Emacs extension to interface with Git repositories. It can be installed from Melpa or Git. The Emacs installation for Windows is precompiled and 100% portable. You just need to extract the zip file which can be downloaded from here. Features of Magit are:

  • Runs directly from the editor using simple commands and keyboard shortcuts. There's no need to open an additional application
  • Portable and cross platform. Still runs when you paste the directory on another machine. Copy the init file from the user directory if you'd like to preserve the configuration as well
  • Up to date
  • Easy to learn commands such as: magit-stage-all, magit-commit, and magit-push with corresponding keyboard shortcuts
2

You can use MinGit [1]. I use the "busybox" version as its smaller (19 MB), and if you want, you can actually extract just these files:

mingw64\bin\git-remote-https.exe
mingw64\bin\git.exe
mingw64\bin\libbrotlicommon.dll
mingw64\bin\libbrotlidec.dll
mingw64\bin\libcrypto-1_1-x64.dll
mingw64\bin\libcurl-4.dll
mingw64\bin\libiconv-2.dll
mingw64\bin\libidn2-0.dll
mingw64\bin\libintl-8.dll
mingw64\bin\libnghttp2-14.dll
mingw64\bin\libpcre2-8-0.dll
mingw64\bin\libssh2-1.dll
mingw64\bin\libssl-1_1-x64.dll
mingw64\bin\libssp-0.dll
mingw64\bin\libunistring-2.dll
mingw64\bin\libwinpthread-1.dll
mingw64\bin\libzstd.dll
mingw64\bin\zlib1.dll
mingw64\ssl\certs\ca-bundle.crt

and it gets down to 7 MB. It seems this has been available since at least 2016 [2] but I only just found it. It seems they dont really advertise it, as I saw one developer say that MinGit is "intended for applications, not for interactive use". However I tested all these commands:

git add
git branch
git checkout
git clean
git clone
git commit
git config
git diff
git log
git push
git reset
git status
git tag

and it seems to work fine for me.

  1. https://github.com/git-for-windows/git/releases
  2. https://github.com/git-for-windows/git/releases/tag/v2.9.0.windows.1
2
  • link doesn't work
    – Jazcash
    Jan 9, 2022 at 16:37
  • 1
    @Jazcash see update
    – Zombo
    Feb 15, 2022 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.