git without bash/cygwin - windows

I'm on a vista laptop, trying out git for the first time.
I installed the msysgit version, and it installed a "git bash" shortcut on the desktop. When I run it, it seems to run in a cygwin kind of box, where C:\ is /c/
Is it safe to use git from the windows command line where /c/ is C:\? does that create any conflict with the way git expects the pathes to be like?
What about, if I init from the bash/cygwin console, then commit from the windows console? Does that create any trouble?

Note: Keep in mind that git does not track where the repository is at -- just references. In other words you can cleanly move an entire git directory (.git + working tree) and it still works fine.
It should work in either case assuming your environment variables allow you to run git from the windows command line.
Both point to the same actual directories (although referenced differently), and use the same executable to modify the repository.

When you install MSYS Git, it will give you 3 options related to system paths. Which one you choose will determine how you can use it. It sounds like you want the 3rd option, "Run Git and included tools from the windows command prompt". This will put all of the git-related binaries in the system path, allowing you to use git from a normal command prompt. Be aware that it also overrides a few built-in windows tools, as the warning in the installer says.

After installing msysgit, you should be able to right click on an empty folder and see options "Git GUI here" and "Git BASH here". If you click Git GUI here it will open a GUI. Have fun!

Related

Git context menu in Windows Exporer has a "git bash" option but it doesn't work

The default git distribution for windows contains, besides the CLI tools, a shell integration, i.e. a context menu for Windows Explorer. This context menu has a "Git bash" option which I suppose should open a Git bash prompt cd'd to the current directory. But instead, the git bash window opens and immediately closes, giving me no chance to even see what it says inside it. Any fix?
Note: Opening Git Bash from the Windows Start Menu works fine, but if I open it that way, then I need to manually cd to the needed dir.
I don't know exactly what distribution/version of git I had before, but now I installed "Git for Windows, version 2.10.1, 32-bit" from https://git-scm.com/download/win and the problem is gone.

Vim fugitive plugin does not recognise git archive on Windows

I installed vim fugitive via pathogen plugin. Helptags created the tags for fugitive.
In the next step I set up a brand new git repo with git init, jumped into that folder, created a README.
In gVim I then run :Gstatus but the split window that opens is empty. :Gcommit tells me that the command git is spelled wrong.
I installed Git-1.7.9-preview20120201.exe for Windows 7 64Bit from here:
http://code.google.com/p/msysgit/downloads/list
Can anybody bring me on the right track?
Regards
It seems gitcommand is not in the PATH environment variable. What happens if you invoke git from Windows command prompt?
msysgit installer provides you 3 options:
Use Git Bash only: PATH won't be edited.
Run Git from Windows Command Prompt: it will add Git to your PATH.
Run Git and included Unix tools from the Windows Command Prompt: Git and several Unix tools will be added to your PATH.
So, you can re-install git with one of the two last options or add manually C:\Program Files\Git\cmd to your PATH.

No such file or directory - git ls-files -- WINDOWS

I am trying to find a way to add Git to the Windows path. Whenever I try to run RakeFiles from either JetBrains' neat IDE, RubyMine or from GitBash itself, I get the error that this title is posted under:
No such file or directory - git ls-files
According to a fellow developer, I need to add Git to my windows path. I haven't been able to find how to remedy this error for anything BUT Macs. Is there anyone who can help me figure out how to fix this with Windows?
Right-click "My computer" and choose Properties
Click Advanced system settings
Click on Environment Variables, under System Variables, find PATH, and add the directory where git.exe is located. Directories are separated with semicolons.
The funny thing is, that this simple operation is very uncomfortable, especially when your PATH is long and people created tools, only to edit system path.

Changing my mind about the PATH when setting up Git for Windows

I have Git on my Windows 7 computer, and when I set it up, I chose Git Bash only, to be safe. Now, I want to install Aptana Studio 3, and one of the requirements is that I have Git, with the ability to use Git from the command line, which I understand is not the case now. How can I go back and change that setting?
Have you tried reinstalling Git? Many windows installers support the concept of reinstalling, allowing you to pick your installation options again.
If that doesn't work, I'd suggest uninstall/reinstall.
You can just edit the system PATH environment variable to include c:\Program Files\Git\cmd or wherever you installed Git to. The git.cmd and gitk.cmd batch scripts setup the right environment and that is all the installer does for you.

MSysGit vs. Git for Windows

I am having trouble determining the difference between MSysGit and Git for Windows. How are they different? Why would I choose one over the other?
Are they not the same thing?
On: http://msysgit.github.com/ The title is Git for Windows, the application is msysgit.
Even in the event they are not, I expect the only differences will be in the method of compilation (i.e. compiler used and any options set) and any extraneous packaging (such as having a bash emulating shell as in msysgit). The actual product (Git itself) should remain broadly similar.
Edit: Thanks to Jarrod for pointing this out. I've left the above in for posterity. To quote the wiki:
msysGit is the development environment
to compile Git for Windows. It is
complete, in the sense that you just
need to install msysGit, and then you
can build Git. Without installing any
3rd-party software.
msysGit is not Git for Windows; that
is an installer which installs Git --
and only Git.
It is easy to see the difference: the
installers for Git have the prefix
Git-, the msysGit installers have the
prefix msysGit-. Another telltale is
that the msysGit installers come in
two flavors: fullinstall and
netinstall. Further, msysGit does not
install to C:\Program Files by
default. But msysGit comes with gcc,
the GNU C Compiler.
So, the difference between the two projects:
msysGit is the msys+mingw environment + everything needed to compile Git yourself, on Windows.
Git for Windows is exactly that: Git, compiled for Windows.
(Now) they are the same (as of May 2015 but likely a bit earlier):
"msysgit" and "Git for Windows" have merged under the name "Git for Windows." msysgit.github.io now hosts "Git for Windows" and the main git download site git-scm.com lists msysgit.github.io as the maintained build for windows.
From the updated wiki:
... we decided to just phase out the name "msysGit" (as well as the GitHub org of the same name) and work on Git for Windows (with the corresponding GitHub org, and using the name "Git for Windows" for the installer aimed at "end-users" and "Git for Windows SDK" for the development environment targeting Git for Windows developers).
Here is the excerpt 'Official README'
"portable" version of Git for Windows (MSysGit) does not need tobe installed. It will run from any directory you place it in, evenonto a USB thumbdrive. It will not write permanent entries into the Windows registry. It does not need administrator privileges to "install". 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.
Git for Windows is newer than msysGit. If you want to use Git version 2.x you need to download from https://github.com/git-for-windows/git/releases. https://github.com/msysgit/git/releases is used for Git version 1.x.
Some technical details from https://github.com/git-for-windows/git/wiki/FAQ
Git for Windows used to be developed using the development environment called "msysGit", but roughly coinciding with Git 2.1, msysGit was superseded by a new development environment: the Git for Windows SDK.
As many answers in this post are old.
As on Nov 2015,
msysGit-based Git for Windows 1.x is now superseded by Git for Windows 2.x.
Git for Windows and git-scm both points to same download location for their binary
Download Location:
https://github.com/git-for-windows/git/releases/download/v2.7.1.windows.2/Git-2.7.1.2-64-bit.exe
The titles on the download page have just been updated so that the "Git for Windows" versions are fully identified. There is now both an 'installed' version (with right click menu options), and a Portable version that runs direct from a memory stick etc.
From what I understand Git on Windows is the project consisting of the four bulletpoints below.
Taken directly from https://github.com/msysgit/msysgit/wiki:
Git on Windows
To make the milky 'soup' of project names more clear, we say like this:
msysGit - is the name of this project, a build environment for Git
for Windows, which releases the official binaries
MinGW - is a minimalist development environment for native Microsoft Windows applications.
MSYS - is a Bourne Shell command line interpreter system, is used by MinGW (and others), was forked in the past from Cygwin
Cygwin - a Linux like environment, which was used in the past to build Git for Windows, nowadays has no relation to msysGit
This is a more clear general comparison right from their site https://github.com/msysgit/msysgit
Git for Windows is the software package that installs a minimal environment to run Git on Windows. It comes with a Bash (a Unix-type shell), with a Perl interpreter and with the Git executable and its dependencies.
On the other hand, msysGit is the software package installing the build environment that can build Git for Windows. The easiest way is to install it via the net installer.
Git for Windows is probably what you want. It includes the following primary features:
Git BASH Git for Windows provides a BASH emulation used to run Git
from the command line. *NIX users should feel right at home, as the
BASH emulation behaves just like the "git" command in LINUX and UNIX
environments.
Git GUI As Windows users commonly expect graphical user
interfaces, Git for Windows also provides the Git GUI, a powerful
alternative to Git BASH, offering a graphical version of just about
every Git command line function, as well as comprehensive visual diff
tools.
Shell Integration Simply right-click on a folder in Windows
Explorer to access the BASH or GUI. The Git-Cheetah plugin also
provides a TortoiseSVN-like interface that displays Git functions
directly on the context menu.
The following is available as a separate download from the same page...
msysGit is a build environment that includes all the tools necessary for developers who want to contribute by writing code for Git for Windows.
Git BASH delivers a familiar environment for Linux experts who occasionally need to use a Windows machine -- even if they don't need git itself. It starts with the BASH prompt and adds a collection of core utility programs such as ssh, find, grep, vi, awk, and of course git.

Resources