This repository has been archived by the owner on Sep 10, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5,257 changed files
with
1,753,458 additions
and
1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
README.portable | ||
======================= | ||
|
||
This version of Git for Windows is portable, i.e. does not need to | ||
be installed. It will run from any directory you place it in, even | ||
from a USB thumbdrive. It will not write permanent entries into the | ||
Windows registry. It does not need administrator privileges to "install". | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
This package is contained in a 7-zip archive with a file name of the form | ||
'PortableGit-<versionstring>.7z.exe'. It is a self-extracting archive: | ||
you can (double-)click it and it will ask for the desired target directory | ||
(which defaults to C:\Program Files\Git). You may change that as needed or | ||
desired. Your user account needs write access to the selected directory. | ||
(You can move that directory with all its contents to a different place or | ||
computer at any time should you later desire so). | ||
|
||
*NOTE*: if you decide to unpack the archive using 7-Zip manually, you must | ||
run the `post-install.bat` script. Git will not run correctly | ||
otherwise. | ||
|
||
Functional differences to the non-portable Git for Windows | ||
---------------------------------------------------------- | ||
|
||
This version does not offer you the convenient right-click context menu | ||
entries "Git GUI Here" and "Git Bash Here", because these would require | ||
to add entries into the Windows registry. | ||
|
||
|
||
Warning | ||
------- | ||
|
||
Since this portable package does not modify any Windows %path% | ||
variables, it is not possible to run the git.exe and gitk.exe files | ||
directly. Start the Git Bash or Git Cmd instead, or add the cmd/ folder | ||
to your %path%. | ||
|
||
|
||
How to start using PortableGit | ||
------------------------------ | ||
|
||
If you are comfortable with a Unix-like shell, just launch 'git-bash.exe'. | ||
|
||
If not, just launch 'git-cmd.exe'. | ||
|
||
Alternatively, you can execute these commands to modify the %path% | ||
variable temporarily: | ||
|
||
set gitdir=c:\portablegit | ||
set path=%gitdir%\cmd;%path% | ||
|
||
Adjust the 'gitdir' according to your setup. As long as you do not | ||
close the command window, you can now simply type "git" or "gitk" to | ||
really call "c:\portablegit\cmd\git.cmd" or "c:\portablegit\cmd\gitk.cmd". | ||
|
||
By default, git-cmd and git-bash use the directory they were started from as | ||
the working directory when run. You can override this by passing --cd-to-home | ||
to them, which will set the user's home directory as the working directory (as | ||
if Git for Windows was installed). | ||
|
||
In addition, if you set the HOME environment variable (either permanently or | ||
for the current session only) you can make Git store the configuration files | ||
and the cloned repositories in the directory specified in that variable. And if | ||
you specify --cd-to-home, git-bash and git-cmd will use that as the | ||
working directory, too. For example: | ||
|
||
set HOME=%cd%/home | ||
git --cd-to-home | ||
will use the relative directory named home (%cd% specifies the current | ||
directory). | ||
|
||
Quick start | ||
----------- | ||
|
||
Start configuring git with your personal settings: | ||
git config --global user.name "Joe Sixpack" | ||
git config --global user.email joe.sixpack@g_mail.com | ||
|
||
Start using git: | ||
git --help | ||
|
||
|
||
How to change %path% permanently | ||
-------------------------------- | ||
|
||
You may also want to make the modification to the %path% variable a | ||
permanent one. The %path% variable may be changed: | ||
|
||
* either on a System level (for all users in the lower pane), if you are | ||
an Administrator | ||
* or for your own user account only (in the upper pane). | ||
|
||
To change the %path% variable permanently: | ||
|
||
* right-click "My Computer", | ||
* select "Properties", | ||
* open "Advanced", | ||
* click "Environment Variables", | ||
* highlight the "Path" variable, | ||
* click "Edit" (either in upper or in lower pane), | ||
* add your specific path to front of "Variable value" field, separated | ||
by a semicolon from the existing entry. | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
@REM Do not use "echo off" to not affect any child calls. | ||
|
||
@REM Enable extensions, the `verify` call is a trick from the setlocal help | ||
@VERIFY other 2>nul | ||
@SETLOCAL EnableDelayedExpansion | ||
@IF ERRORLEVEL 1 ( | ||
@ECHO Unable to enable extensions | ||
@GOTO failure | ||
) | ||
|
||
@REM Start the ssh-agent if needed by git | ||
@FOR %%i IN ("git.exe") DO @SET GIT=%%~$PATH:i | ||
@IF EXIST "%GIT%" @( | ||
@REM Get the ssh-agent executable | ||
@FOR %%i IN ("ssh-agent.exe") DO @SET SSH_AGENT=%%~$PATH:i | ||
@IF NOT EXIST "%SSH_AGENT%" @( | ||
@FOR %%s IN ("%GIT%") DO @SET GIT_DIR=%%~dps | ||
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_DIR=!GIT_DIR:~0,-1! | ||
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_ROOT=%%~dps | ||
@FOR %%s IN ("!GIT_ROOT!") DO @SET GIT_ROOT=!GIT_ROOT:~0,-1! | ||
@FOR /D %%s in ("!GIT_ROOT!\usr\bin\ssh-agent.exe") DO @SET SSH_AGENT=%%~s | ||
@IF NOT EXIST "!SSH_AGENT!" @GOTO ssh-agent-done | ||
) | ||
@REM Get the ssh-add executable | ||
@FOR %%s IN ("!SSH_AGENT!") DO @SET BIN_DIR=%%~dps | ||
@FOR %%s in ("!BIN_DIR!") DO @SET BIN_DIR=!BIN_DIR:~0,-1! | ||
@FOR /D %%s in ("!BIN_DIR!\ssh-add.exe") DO @SET SSH_ADD=%%~s | ||
@IF NOT EXIST "!SSH_ADD!" @GOTO ssh-agent-done | ||
@REM Check if the agent is running | ||
@FOR /f "tokens=1-2" %%a IN ('tasklist /fi "imagename eq ssh-agent.exe"') DO @( | ||
@ECHO %%b | @FINDSTR /r /c:"[0-9][0-9]*" > NUL | ||
@IF "!ERRORLEVEL!" == "0" @( | ||
@SET SSH_AGENT_PID=%%b | ||
) else @( | ||
@REM Unset in the case a user kills the agent while a session is open | ||
@REM needed to remove the old files and prevent a false message | ||
@SET SSH_AGENT_PID= | ||
) | ||
) | ||
@REM Connect up the current ssh-agent | ||
@IF [!SSH_AGENT_PID!] == [] @( | ||
@ECHO Removing old ssh-agent sockets | ||
@FOR /d %%d IN (%TEMP%\ssh-??????*) DO @RMDIR /s /q %%d | ||
) ELSE @( | ||
@ECHO Found ssh-agent at !SSH_AGENT_PID! | ||
@FOR /d %%d IN (%TEMP%\ssh-??????*) DO @( | ||
@FOR %%f IN (%%d\agent.*) DO @( | ||
@SET SSH_AUTH_SOCK=%%f | ||
@SET SSH_AUTH_SOCK=!SSH_AUTH_SOCK:%TEMP%=/tmp! | ||
@SET SSH_AUTH_SOCK=!SSH_AUTH_SOCK:\=/! | ||
) | ||
) | ||
@IF NOT [!SSH_AUTH_SOCK!] == [] @( | ||
@ECHO Found ssh-agent socket at !SSH_AUTH_SOCK! | ||
) ELSE ( | ||
@ECHO Failed to find ssh-agent socket | ||
@SET SSH_AGENT_PID= | ||
) | ||
) | ||
@REM See if we have the key | ||
@SET "HOME=%USERPROFILE%" | ||
@"!SSH_ADD!" -l 1>NUL 2>NUL | ||
@SET result=!ERRORLEVEL! | ||
@IF NOT !result! == 0 @( | ||
@IF !result! == 2 @( | ||
@ECHO | @SET /p=Starting ssh-agent: | ||
@FOR /f "tokens=1-2 delims==;" %%a IN ('"!SSH_AGENT!"') DO @( | ||
@IF NOT [%%b] == [] @SET %%a=%%b | ||
) | ||
@ECHO. done | ||
) | ||
@"!SSH_ADD!" | ||
@ECHO. | ||
) | ||
) | ||
|
||
:ssh-agent-done | ||
:failure | ||
|
||
@ENDLOCAL & @SET "SSH_AUTH_SOCK=%SSH_AUTH_SOCK%" ^ | ||
& @SET "SSH_AGENT_PID=%SSH_AGENT_PID%" | ||
|
||
@ECHO %cmdcmdline% | @FINDSTR /l "\"\"" >NUL | ||
@IF NOT ERRORLEVEL 1 @( | ||
@CALL cmd %* | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@REM Do not use "echo off" to not affect any child calls. | ||
|
||
@REM The goal of this script is to simplify launching `ssh-pageant` at | ||
@REM logon, typically by dropping a shortcut into the Startup folder, so | ||
@REM that Pageant (the PuTTY authentication agent) will always be | ||
@REM accessible. No attempt is made to load SSH keys, since this is | ||
@REM normally handled directly by Pageant, and no interactive shell | ||
@REM will be launched. | ||
@REM | ||
@REM The `ssh-pageant` utility is launched with the `-r` (reuse socket) | ||
@REM option, to ensure that only a single running incarnation (per user) | ||
@REM will be required... instead of launching a separate process for | ||
@REM every interactive Git Bash session. A side effect of this selection | ||
@REM is that the SSH_AUTH_SOCK environment variable *must* be set prior | ||
@REM to running this script, with the value specifying a unix-style socket | ||
@REM path, and needs to be consistent for all git-related processes. The | ||
@REM easiest way to do this is to set a persistent USER environment | ||
@REM variable, which (under Windows 7) can be done via Control Panel | ||
@REM under System / Advanced System Settings. A typical value would look | ||
@REM similar to: | ||
@REM | ||
@REM SSH_AUTH_SOCK=/tmp/.ssh-pageant-USERNAME | ||
@REM | ||
|
||
@REM Enable extensions, the `verify` call is a trick from the setlocal help | ||
@VERIFY other 2>nul | ||
@SETLOCAL EnableDelayedExpansion | ||
@IF ERRORLEVEL 1 ( | ||
@ECHO Unable to enable extensions | ||
@GOTO failure | ||
) | ||
|
||
@REM Ensure that SSH_AUTH_SOCK is set | ||
@if "x" == "x%SSH_AUTH_SOCK%" @( | ||
@ECHO The SSH_AUTH_SOCK environment variable must be set prior to running this script. >&2 | ||
@ECHO This is typically configured as a persistent USER variable, using a MSYS2 path for >&2 | ||
@ECHO the ssh-pageant authentication socket as the value. Something similar to: >&2 | ||
@ECHO. >&2 | ||
@ECHO SSH_AUTH_SOCK=/tmp/.ssh-pageant-%USERNAME% >&2 | ||
@GOTO failure | ||
) | ||
|
||
@REM Start ssh-pageant if needed by git | ||
@FOR %%i IN ("git.exe") DO @SET GIT=%%~$PATH:i | ||
@IF EXIST "%GIT%" @( | ||
@REM Get the ssh-pageant executable | ||
@FOR %%i IN ("ssh-pageant.exe") DO @SET SSH_PAGEANT=%%~$PATH:i | ||
@IF NOT EXIST "%SSH_PAGEANT%" @( | ||
@FOR %%s IN ("%GIT%") DO @SET GIT_DIR=%%~dps | ||
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_DIR=!GIT_DIR:~0,-1! | ||
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_ROOT=%%~dps | ||
@FOR %%s IN ("!GIT_ROOT!") DO @SET GIT_ROOT=!GIT_ROOT:~0,-1! | ||
@FOR /D %%s in ("!GIT_ROOT!\usr\bin\ssh-pageant.exe") DO @SET SSH_PAGEANT=%%~s | ||
@IF NOT EXIST "!SSH_PAGEANT!" @GOTO ssh-pageant-done | ||
) | ||
) | ||
|
||
@REM Time to make the donuts! | ||
@ECHO Starting ssh-pageant... | ||
@FOR /f "usebackq tokens=1 delims=;" %%o in (`"%SSH_PAGEANT%" -qra %SSH_AUTH_SOCK%`) DO @ECHO %%o | ||
|
||
:ssh-pageant-done | ||
:failure |
Oops, something went wrong.