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

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.

Related

Install patch file in Redmine for windows

I want to install a patch file in Windows server for redmine. When executing in cmd:
patch -p0 < file.patch
I get the error: patch commmand not found
Any ideas?
Patch takes a patch file containing a difference listing produced by the diff program and applies those differences to one or more original files, producing patched versions.
It's native to unix/linux os-es, but for Windows, you need to install patch.exe and add it to system's or user's environment variable PATH
Probably best way is to install
http://gnuwin32.sourceforge.net/packages/patch.htm
On Windows it differs from version to version, but it looks somewhat like this:
From the desktop, right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab
In the Advanced section, click the Environment Variables button.
Then, in the Environment Variables window, edit the Path variable in the Systems Variable.
Add or modify the path lines with the paths you wish your console to access. Directories are separated with a semicolon as shown below.
C:\Program Files\; C:\Windows\System32
Example of path location in windows : C:\util\patch\

Windows 10 cannot recognize Git

I have installed Windows 10 x64 on my laptop, and then go with latest Git as well (Git-2.6.3-64-bit). As I see on my laptop, Git now is installed at this directory: C:\Users\MyPC\AppData\Local\Programs\Git (I have no chance to specify another particular folder because it's done automatically during Git installation). The options "Use Git from the Windows Command Prompt" and "Use OpenSSH" are already selected, the windows path is updated with Git dir. And after all, the problem is, Windows cannot recognize where Git is to call. I've tried git --version but it's unrecognized from Windows.
My questions are (on Windows 10 Pro x64):
1. Can we specify another installation folder for Git?
2. In Git dir/bin, there no ssh.exe, while in OpenSSH selection dialog, it tells me "This uses ssh.exe that comes with Git". So where is it, the built-tin SSH client?
3. I'm doubting that now Windows 10 doesn't accept any external program installed on %USERPROFILE%/AppData to be included to system path. Is it correct?
4. How to make Windows "see" Git?
Just solved this myself this was a very frustrating journey but for me the following got me going:
Make sure c:\Windows\System32\OpenSSH\ is in your path variables (yea I know Windows should see this on its own)
Go to C:\Users\<>.gitconfig edit your global git config file to point to the correct ssh.exe 'C:/Windows/System32/OpenSSH
Make sure your id_rsa.ppk file is in C:\Users\<>.ssh If you don't have an SSH key yet generate one and make sure it ends up in this folder
You may also want to check that your OpenSSH Authentication Agent is started in Windows Services
Can we specify another installation folder for Git?
Try running the installer as an administrator, so it can be installed to Program Files. I'm not sure how to specify a custom path.
In Git dir/bin, there no ssh.exe, while in OpenSSH selection dialog, it tells me "This uses ssh.exe that comes with Git". So where is it, the built-tin SSH client?
Some digging told me that it might live inside the .ssh folder in the Git installation, so C:\Users\MyPC\AppData\Local\Programs\Git\.ssh
I'm doubting that now Windows 10 doesn't accept any external program installed on %USERPROFILE%/AppData to be included to system path. Is it correct?
AFAIK you can add any directory to your path.
How to make Windows "see" Git?
Add C:\Users\MyPC\AppData\Local\Programs\Git to your path:
Start the System Control Panel applet (Start - Settings - Control Panel - System).
Select the Advanced tab.
Click the Environment Variables button.
Under System Variables, select Path, then click Edit.
You'll see a list of folders, as this example for my system shows: C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Intel\DMIX;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Bonjour\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Misc
You can add additional folders that you want to include in searches. I add a "C:\program files\misc" entry into which I place my standalone utilities, instead of copying them into C:\windows. Click OK.
You'll need to restart the processes (e.g., command prompt) that use the system path to see the added folders.
From http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

How to install Git Shell

Windows 7 Ultimate
I used to have Git Shell installed. The icon is grey with a cat face. It was either installed by the Git or by GitHub for Windows.
Somehow I've lost it.
I've tried re-installing both Git and GitHub for Windows, but I can't get it back.
If you have GitHub for Windows (installed, it should come with your shortcut.
It is a shortcut to:
C:\Users\Username\AppData\Local\GitHub\GitHub.appref-ms --open-shell
More recent versions of G4W (see answer below) could have it at:
%LOCALAPPDATA%\Apps\2.0\...\...\
C:\Users\Username\AppData\Local\Apps\2.0\GitHub\GitHub.appref-ms --open-shell
If that shell complains about the absence of git, launch "G4W" itself, which will extract git.
See "Where is git.exe located?".
As mentioned below, to restore the shortcut, after having run the first command, execute in the Git shell:
github --reinstall-shortcuts
Try running the following command:
github --reinstall-shortcuts
That repaired the Git Shell shortcut for me, and also put the proper icon back.
I found out that the answer that you specifically wanted involves a combination of the previous answers:
1. Running the Git Shell via the command line (Since you lost the shortcut)
C:\Users\Username\AppData\Local\GitHub\GitHub.appref-ms --open-shell
2. Once youre in the Git Shell run the command in the previous answer
github --reinstall-shortcuts
You'll find the Git Shell with the grey cat icon that originally came with the GitHub setup in the desktop.
Windows 10
Git-2.19.0-64
The Git Shell is installed by default in:
C:\Program Files\Git\git-bash.exe
Try create a shortcut to your desktop, not sure if this answer your question.
The direct link for Git Shell is now:
https://git-scm.com/downloads
I ran into this same issue today, and since this is the first Google result for my query trying to find a solution, I'll post what I sorted here.
It looks like GitHub for Windows installs some or all of itself into %LOCALAPPDATA%\Apps\2.0\...\...\* and this reference was broken on Git Shell .lnk shortcut on the desktop. The GitHub.exe file pointed to did not exist; the entire path was missing.
I viewed properties on the .lnk file (select Properties from context menu or ALT+ENTER on keyboard with .lnk selected) and clicked the Change Icon button. A message box appeared noting that the path to the old icon file was missing and what the bad path was.
I found the "current" path by poking about in the above noted directory and finding GitHub.exe again. The icon is one of three available in GitHub.exe; I expect this is what some of the other answers (like the reinstall-shortcuts suggestion) accomplish.
Hope this helps someone!
(Which seems to be normal for .NET ClickOnce applications; those ... are randomized/obfuscated/generated so they will look like gibberish. My specific working path, as an example, ended up being: C:\Users\anshou\AppData\Local\Apps\2.0\RZ33EP02.2J7\5OMOZAGM.89T\gith..tion_317444273a93ac29_0001.0003_e68db37a99107794 -- note that this path is not truncated, that is the exact path, double period and all.)

I can't find my MinGW shell after installing with GUI installer

I used Mingw_get_inst and installed the MinGW compiler suite following the instructions on the howto page. I used the GUI installer. I then changed the path to include C:\MingW; . When I go to Start menu -> all programs -> MingW the only file that exists inside of there is a uninstaller. The howto page says a shell should be there... can someone help me get this working?
Howto page on Mingw.org: http://www.mingw.org/wiki/Getting_Started
simply you could run it from the following batch file:
e.g. C:\MinGW\msys\1.0\msys.bat (if you installed your mingw in c drive)
for more info. about mysys, check this
Look at the install logs for your Mingw.
I have 2 bin dirs in my (single) installation of Mingw
C:\MinGW\msys\1.0\bin
and
C:\MinGW\bin
A lot has changed about Mingw in the last 2-3 years and I think some documentation you might find easily via google is out-of-date.
Try asking for help at mingw mail groups via Nabble (very easy to use)
IHTH
Adding the shell link is easy if you have MSYS installed.
Open your Start menu and right-click on "All Program" and choose either "Open" or "Open All Users" depending on which you want to set the shortcut for. Open the MinGW folder if it already exists, or create it (or an MSYS folder, as you wish) if it does not.
Open another Explorer window and navigate to your MSYS folder, in the default installation this is C:\MinGW\msys\1.0
Right-drag msys.bat from the MSYS explorer window to the start menu explorer window. Choose "Create shortcut" when prompted as to what you wish to do. Optionally, you may want to change the shortcut to use one of the MSYS icons from the MSYS folder.
According to older MSYS documentation, the shortcut should be set to start in the MSYS bin folder, in the default installation this is C:\MinGW\msys\1.0\bin. I'm not certain of what happens if you don't do this; the shell opens either way.
Et voilĂ ! You now have a shell link for MSYS in your Start menu.
If you didn't have the shortcut, the other postinstall bits may not have run either. The easy way to check this is to look in C:\MinGW\msys\1.0\etc (or the appropriate path for your installation). If there is an fstab file, then the postinstall bits ran appropriately. If not, then go to C:\MinGW\msys\1.0\postinstall and run pi.bat. This will make the mingw folder available from the msys shell. Things won't work right without doing this.
Update from March 2018: The MSYS postinstall is now a Lua script, and it won't create a shortcut by default. Best I can tell, you now must do so manually in all cases.
Look for the postinstall directory, run the batch file pi.bat in there and
answer the file path questions with the correct case sensitivity.
Then gcc is found.
CNTRL-SHIFT click and drag the msys shortcut onto the desktop.
This fixes it.
Pity the installation script is broken...
Go to your windows search and go to Apps and Features and then search for it, you can find the file location and then you can probably see docs and other files :)

git without bash/cygwin

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!

Resources