Page 1 of 1

msysGit - Portable Git for Windows (preview)

Posted: Mon Oct 14, 2013 12:30 pm
by TP109
A portable version of Git for Windows (MSysGit). MysGit is an almost feature-complete fork of Git on Windows, offering a Unix-type shell and a Perl interpreter using a very minimal version of MSys. Historically, Git on Windows was only officially supported using Cygwin. To help make a native Windows version, this project was started, based on the MinGW fork.

Code license:GNU GPL v2

MSysGit Home on GitHub:
http://github.com/msysgit/msysgit/wiki
http://msysgit.github.io/

MSysGit howto:
http://githowto.com/

Portable version download (PortableGit-1.8.4-preview20130916.7z):
http://code.google.com/p/msysgit/

If file extension is renamed to .exe, file becomes a self-extracting archive. Otherwise, use 7zip to extract to the desired location.I

I did not test this for portability. It's still a preview version. Might be of interest to developers on this board.

Re: msysGit - Portable Git for Windows (preview)

Posted: Tue Oct 15, 2013 1:29 pm
by robertcollier4
msysgit portable works nicely. Here are some things you have to do to set up.

1. Set the home folder to a relative location by editing etc/profile. Find the following lines in the file etc/profile:

Code: Select all

# normalize HOME to unix path
HOME="$(cd "$HOME" ; pwd)"
Change them to:

Code: Select all

# normalize HOME to unix path
HOME="/home" #portablefreeware set home to relative location
HOME="$(cd "$HOME" ; pwd)"
2. Then you can correctly create /home/.gitconfig and /home/.ssh folder ssh key files to authenticate with Git as per these instructions:
http://markashleybell.com/portable-git- ... iable.html
https://help.github.com/articles/generating-ssh-keys

3. To get a colored and helpful prompt and colored directory listings, create a file /home/.bashrc containing:

Code: Select all

shopt -s promptvars
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='\[\033[1;36m\]\[\033[0m\]\[\033[1;34m\]\w\[\033[0m\] \[\033[1;32m\]$(__git_ps1)\[\033[0m\]\$ '

# enable color support of ls
alias ls='ls --color=auto -alhX'
4. Turn off automatic Windows-Unix line-ending conversion (best to manage this yourself with a good text editor). In Git Bash prompt type:

Code: Select all

git config --global core.autocrlf true

Re: msysGit - Portable Git for Windows (preview)

Posted: Fri Oct 18, 2013 6:25 am
by TP109
Places .bashrc in the user's home directory (Documents and Settings/user for XP) by default. The following guide shows how change that by using a home/user folder within the installation as well as a couple of more tweaks for maximum portability. It's working using the new home location. I haven't gone through the entire guide yet to set up profile.

http://markashleybell.com/portable-git- ... iable.html

Re: msysGit - Portable Git for Windows (preview)

Posted: Fri Oct 18, 2013 11:08 am
by freakazoid
I've been using msysGit Portable for awhile now.

Definitely follow Mark's advice in his article. I'm also hacking msysGit to use SVN and other bash-related stuff.

Re: msysGit - Portable Git for Windows (preview)

Posted: Fri Oct 18, 2013 11:32 am
by TP109
Credit to robertcollier4 for pointing out the home folder change, the links to the setup guides, as well as his other tips in the 2nd post.

For those using XP, you may need to install clip.exe to copy public key to the clipboard, depending on your version (I'm using Home). See article below:

http://github.com/railsinstaller/railsi ... /issues/26

This worked for me:
http://www.c3scripts.com/tutorials/msdos/clip.html

If following Mark's guide, http://markashleybell.com/portable-git- ... iable.html, the ssh agent script should be placed in a file named ".profile" instead of "profile" in your home directory; otherwise, the file won't load. Although it starts the ssh agent, I get a grep error. Anyone else getting this?

Also, to have msysGit use your home directory on startup, you can create a shortcut from git-bash.bat and enter the path to your home directory in the "Start in:" section of properties. Additionally, you can setup Console2 with git-bash.bat and define the start up directory there.

I changed my prompt settings to the following in .bashrc (updated, the other prompt was causing issues):
PS1='\n\e[1;36m$(pwd)\e[m\n\e[1;33m[\h]:[\u]\e[m\n->'

Successful at merging, pulling, pushing, etc between local and remote repo using the msysGit GUI with ssh after making the changes indicated above.

Re: msysGit - Portable Git for Windows (preview)

Posted: Mon Oct 21, 2013 12:10 pm
by freakazoid
TP109 wrote:Additionally, you can setup Console2
I use mintty instead of Console2. Also try ConEmu.

Re: msysGit - Portable Git for Windows (preview)

Posted: Mon Oct 21, 2013 12:56 pm
by robertcollier4
freakazoid wrote:
TP109 wrote:Additionally, you can setup Console2
I use mintty instead of Console2. Also try ConEmu.
To start it with ConEmu, you can use following command-line or shortcut:

Code: Select all

D:\PortableApps\ConEmu\ConEmu.exe /cmd D:\PortableApps\msysgit\bin\bash.exe --login -i -cur_console:n

Re: msysGit - Portable Git for Windows (preview)

Posted: Mon Oct 21, 2013 1:09 pm
by robertcollier4
TP109 wrote:If following Mark's guide, http://markashleybell.com/portable-git- ... iable.html, the ssh agent script should be placed in a file named ".profile" instead of "profile" in your home directory; otherwise, the file won't load. Although it starts the ssh agent, I get a grep error. Anyone else getting this?
I ended up removing all of the code to auto-start the ssh agent and it seems to still work fine without ever asking me for my password. I think the new version of msysgit loads the ssh agent internally by itself without needing to have it run in a separate process. My /home/.profile only contains and it works fine:

Code: Select all

SSH_ENV="$HOME/.ssh/environment"
TP109 wrote:the ssh agent script should be placed in a file named ".profile" instead of "profile" in your home directory;
The profile file in etc folder is without a period, the .profile file in home folder is with a period - that is, /etc/profile and /home/.profile

Also here is a way to get msysgit to use WinMerge (portable) to do directory diff:
http://stackoverflow.com/a/17074271

Re: msysGit - Portable Git for Windows (preview)

Posted: Mon Oct 21, 2013 5:09 pm
by TP109
freakazoid wrote:
TP109 wrote:Additionally, you can setup Console2
I use mintty instead of Console2. Also try ConEmu.
I also use mintty. Trying ConEmu with the start up command provided by robertcollier4. ConEmu has tons of configurable options. Works nicely. Any reason this app not included in the PFC database?
robertcollier4 wrote:I ended up removing all of the code to auto-start the ssh agent and it seems to still work fine without ever asking me for my password. I think the new version of msysgit loads the ssh agent internally by itself without needing to have it run in a separate process. My /home/.profile only contains and it works fine:

Code: Select all

SSH_ENV="$HOME/.ssh/environment"
That worked if not using a pass phrase. After changing the keys to include a pass phrase, it was necessary to start ssh-agent using the script or else entering the pass phrase for every server connection. Didn't try erasing everything out of .profile except for the code above using pass phrase protected keys yet. As it is configured now, I just have to enter the pass phrase once when starting the shell. See http://www.halyph.com/2012/08/how-to-us ... ysgit.html
robertcollier4 wrote:The profile file in etc folder is without a period, the .profile file in home folder is with a period - that is, /etc/profile and /home/.profile
I noticed that too.
robertcollier4 wrote:The Also here is a way to get msysgit to use WinMerge (portable) to do directory diff:
http://stackoverflow.com/a/17074271
Configuring msysGit to use winmerge portable now according to your consolidated SO post. Yep, that thread was getting messy alright. Gave it an up vote.

Re: msysGit - Portable Git for Windows (preview)

Posted: Sun Jan 03, 2016 1:40 pm
by Midas
msysGit renamed Git For Windows; version is currently v2.6.4 (site moved; changelog is now at http://github.com/git-for-windows/git/releases/).

Re: msysGit - Portable Git for Windows (preview)

Posted: Sat Jan 16, 2016 10:40 pm
by SYSTEM
Git for Windows 2.7.0 is available: https://github.com/git-for-windows/git/ ... .windows.1

Re: msysGit - Portable Git for Windows (preview)

Posted: Sat Apr 09, 2016 7:36 pm
by SYSTEM
Git for Windows 2.8.1 up.

Re: msysGit - Portable Git for Windows (preview)

Posted: Sat Sep 03, 2016 9:01 pm
by SYSTEM
Git for Windows 2.10.0 up.

Re: msysGit - Portable Git for Windows (preview)

Posted: Sun Dec 04, 2016 1:28 am
by SYSTEM
Git for Windows 2.11.0 up.

Re: msysGit - Portable Git for Windows (preview)

Posted: Sun Dec 04, 2016 7:20 am
by shnbwmn
Small note regarding the Git sites: the official Git site hosts the Git for Windows download as the default for Windows.

Also: GitPortable (PortableApps format)