msysGit - Portable Git for Windows (preview)

Submit portable freeware that you find here. It helps if you include information like description, extraction instruction, Unicode support, whether it writes to the registry, and so on.
Post Reply
Message
Author
TP109
Posts: 571
Joined: Sat Apr 08, 2006 7:12 pm
Location: Midwestern US

msysGit - Portable Git for Windows (preview)

#1 Post 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.

robertcollier4
Posts: 39
Joined: Fri Apr 12, 2013 3:20 am

Re: msysGit - Portable Git for Windows (preview)

#2 Post 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
Last edited by robertcollier4 on Mon Oct 21, 2013 11:16 pm, edited 3 times in total.

TP109
Posts: 571
Joined: Sat Apr 08, 2006 7:12 pm
Location: Midwestern US

Re: msysGit - Portable Git for Windows (preview)

#3 Post 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

freakazoid
Posts: 1234
Joined: Wed Jul 18, 2007 5:45 pm

Re: msysGit - Portable Git for Windows (preview)

#4 Post 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.
is it stealth? ;)

TP109
Posts: 571
Joined: Sat Apr 08, 2006 7:12 pm
Location: Midwestern US

Re: msysGit - Portable Git for Windows (preview)

#5 Post 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.
Last edited by TP109 on Thu Nov 07, 2013 12:46 pm, edited 1 time in total.

freakazoid
Posts: 1234
Joined: Wed Jul 18, 2007 5:45 pm

Re: msysGit - Portable Git for Windows (preview)

#6 Post by freakazoid »

TP109 wrote:Additionally, you can setup Console2
I use mintty instead of Console2. Also try ConEmu.
is it stealth? ;)

robertcollier4
Posts: 39
Joined: Fri Apr 12, 2013 3:20 am

Re: msysGit - Portable Git for Windows (preview)

#7 Post 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
Last edited by robertcollier4 on Mon Oct 21, 2013 1:10 pm, edited 1 time in total.

robertcollier4
Posts: 39
Joined: Fri Apr 12, 2013 3:20 am

Re: msysGit - Portable Git for Windows (preview)

#8 Post 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

TP109
Posts: 571
Joined: Sat Apr 08, 2006 7:12 pm
Location: Midwestern US

Re: msysGit - Portable Git for Windows (preview)

#9 Post 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.

User avatar
Midas
Posts: 6912
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: msysGit - Portable Git for Windows (preview)

#10 Post 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/).

User avatar
SYSTEM
Posts: 2045
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: msysGit - Portable Git for Windows (preview)

#11 Post by SYSTEM »

Git for Windows 2.7.0 is available: https://github.com/git-for-windows/git/ ... .windows.1
My YouTube channel | Release date of my 13th playlist: August 24, 2020

User avatar
SYSTEM
Posts: 2045
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: msysGit - Portable Git for Windows (preview)

#12 Post by SYSTEM »

Git for Windows 2.8.1 up.
My YouTube channel | Release date of my 13th playlist: August 24, 2020

User avatar
SYSTEM
Posts: 2045
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: msysGit - Portable Git for Windows (preview)

#13 Post by SYSTEM »

Git for Windows 2.10.0 up.
My YouTube channel | Release date of my 13th playlist: August 24, 2020

User avatar
SYSTEM
Posts: 2045
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: msysGit - Portable Git for Windows (preview)

#14 Post by SYSTEM »

Git for Windows 2.11.0 up.
My YouTube channel | Release date of my 13th playlist: August 24, 2020

shnbwmn
Posts: 265
Joined: Sat Jul 11, 2015 12:59 am

Re: msysGit - Portable Git for Windows (preview)

#15 Post 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)

Post Reply