vs code git error: Git: /usr/bin/bash: init: No such file or directory - windows

EDIT: I've rebooted my computer, and the issue is fixed. I have no idea why it fixed it.
In vs code on windows, when I try to Initialize Repository, I get the error
However, it used to worked fine. It changed when I tried to install Ubuntu on Windows following this video. Git is installed, and the path is in the .json file.

I'll recommend you to install git in ubuntu by apt

The git.path you've specified is to bash, not git. There's probably some wrapper that invokes that binary using git, and so when you type git init, you're really invoking bash init, which asks bash to run the script named init. Since it doesn't exist, your command is failing.
You should set git.path to a path to a Git binary, and not a bash binary.

Related

How to install go-sql-driver on Windows

I am trying to install go-sql-driver on Windows Vista but I am having problems with GOPATH.
I installed git as suggested and added GOPATH as a new user environment in Windows with path C:/users/A/desktop/go.
I ran go get github.com/go-sql-driver/mysql in the command line but it gives me this error:
C:\>go get github.com/go-sql-driver/mysql
go: missing Git command. See http://golang.org/s/gogetcmd
package github.com/go-sql-driver/mysql: exec: "git": executable file not found in %PATH%
When I go look at http://golang.org/s/gogetcmd it merely says download git. But it is already downloaded in my machine.
I also went ahead and created a new environement variable for PATH and set its path to the directory where git was installed but that did not help either.
What am I doing wrong?
Download the Windows version of Git from http://git-scm.com/downloads.
Run the downloaded executable file, currently Git-1.8.3-preview20130601.exe, which will start a Git Setup wizard to install Git.
Check Git Setup Options
Run Git from the Windows Command Prompt
Checkout as-is, commit Unix-style line endings
Check the installation by running:
C:\>git --version
git version 1.8.3.msysgit.0
Make sure Git is in the %PATH% environment variable and ensure Git is installed. If you cannot run git --version in the command prompt, then the Git binary directory isn't listed in your %PATH%. Fix this by adding Git to the path, close the command prompt, and run git --version in a new command prompt. If you're still having issues, then you might be having other problems.
Install the GIT BASH desktop app in your Windows PC. The download link is here. Once installed, open the shell and type:
go get -u github.com/go-sql-driver/mysql
This will install driver for Golang's MySQL database package

How to install, compile, and utilize Rebar in Windows 8

Is this possible?
All tutorials I've come across on how to build and use Rebar involve Unix commands, and I'm a most unfortunate Windows user. I'd really like to avoid installing Cygwin if I can help it.
For example, to build Rebar you get:
$ git clone git://github.com/rebar/rebar.git
$ cd rebar
$ ./bootstrap
Recompile: src/getopt
...
Recompile: src/rebar_utils
==> rebar (compile)
Congratulations! You now have a self-contained script called "rebar" in
your current working directory. Place this script anywhere in your path
and you can use rebar to build OTP-compliant apps.
What is the windows-cmd equivalent?
Any links or tutorial below to offer step by step instructions on how to utilize rebar in windows shell would be greatly appreciated.
UPDATE:
After manually downloading and extracting Rebar to my directory located at:
C:\erlang\rebar
I go to the windows shell and enter:
SET PATH=C:\Program Files\erl5.10.1\bin
This is the 'bin' folder located inside the directory holding erlang.exe
Next I enter:
C:\erlang\rebar>bootstrap.bat
Compiled! :)
There should be a bootstrap.bat script in the rebar directory. You don't need cygwin for this to work, but you will need Erlang installed and on the path.
I assume you have erlang istalled already and added to your path.
You can just download the Git and install it. Then open the git bash and type
git clone https://github.com/rebar/rebar.git
once cloned it to your desired location then you can run the command by going inside the rebar directory.
./bootstrap
Now it will work just fine and tell you that you have the rebar file compiled in your current working directory.
Nice you are good to go with using rebar for your project.
You can also just invoke path\to\erlang-install\bin\escript.exe bootstrap from a (Windows) command shell.
bootstrap is just an e(rlang) script.
You can download and install Git for Windows
Then, use it to run the same exact instructions:
git clone git://github.com/rebar/rebar.git
cd rebar
./bootstrap
and everything should work fine.

Git hanging after installing osx credential helper

I'm having the same problem as this thread: Git hangs indefinitely - broke with osx credential helper I think
Basically -- had been running git without problems, then installed the credential-osxkeychain and git began hanging indefinitely after any command. e.g., running git init results in a hanging prompt and any input creates an error: bad input
I tried following the advice to delete git from usr/bin/git but now it doesn't recognize anything. I tried reinstalling git but now it doesn't seem to recognize it.
I ran which git and it returns: /usr/local/git/bin/git
I'm somewhat new at this and don't have the balls to just start running sudo commands and moving things around in the /usr/bin directory.
Any ideas what I can do to fix this?
I had the same problem and fixed it thusly:
uninstall git via the uninstall.sh that comes with the install
reinstall git via the installer
run which git and cd to the folder containing git (eg. cd /usr/local/git/bin/)
run curl -O http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain
run chmod u+x git-credential-osxkeychain
run git config --global credential.helper osxkeychain
Fixed.
Still not totally sure what I actually did to fix this problem, but resetting the terminal ended up getting it to work.
I had the same problem.
I didnt have git 1.7.10 or later installed. Messed everything up.
To fix, I had to delete git and install a newer version.
I used homebrew to install, after deleting.
is working again.
To fix this I reinstalled git from http://git-scm.com/download/mac
and then added /usr/local/git/bin to the top of the file /etc/paths

Github not installed in terminal os

I downloaded and installed GitHub (latest version) for OS X, installed command line utility under Github in the application and am coming up with an error trying to create my first readme file in a repo entitled "basic-twitbstrap".
Macbooks-MacBook-Pro-2:basic-twitbstrap macbook$ git init
-bash: git: command not found
If they're not installed in standard location, command-line programs need some environment modifications to be called, which consists in adding their directory to the PATH environment variable.
So in your case you need to add /usr/local/github to your path, see how.
I installed the latest version of Ruby Version Manager, then entered 'git' into the Terminal. It came up with a list of usage and common commands.
Now it runs.
Macbooks-MacBook-Pro-2:~ macbook$ git --version
git version 1.7.4.4

override git from Xcode with homebrew version

I've installed XCode and therefore git is there as well. Since i want to have a newer version of git I installed using homebrew.
But the homebrew version of git is never called since my PATH looks like this
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
which means the /usr/bin/git is allways called before /usr/local/bin/git.
Is there a way to change that without changing the PATH?
Xcode is actually using the GIT that is stored in /Applications/Xcode.app/Contents/Developer/usr/bin. The same version of GIT gets installed in /usr/bin when you installed the command line tools as part of Xcode installation. So, you won't be able to change what Xcode is using (unless you are willing to muck with the contents of the Xcode package). If, from a terminal application, you want to use the homebrew-installed GIT then you have two options:
Reference GIT with the full path as /usr/local/bin/git ... For this case you can create an alias like alias mgit=/usr/local/bin/git and then use mgit ... from the terminal
Change the path as PATH=/usr/local/bin:$PATH either in your .bashrc or .zshrc if you use zsh file (or each time you start a terminal at the command line).
Since Xcode hard coded its own version of git which is installed on /Applications/Xcode.app/Contents/Developer/usr/bin/git, I managed to use this work around trick:
change into the Xcode directory:
cd /Applications/Xcode.app/Contents/Developer/usr/bin
rename the Xcode's git like this:
sudo mv ./git ./git-xcode-usr-bin
link my own git which is installed through homebrew:
sudo ln -s /usr/local/bin/git ./git
And I did the same thing with /usr/bin/git
This will acctually link /usr/local/Cellar/git/1.8.0/bin/git (because I'm use git 1.8.0 at the present)
Certainly this may cause some other problems, such as when I upgrade the homebrew's verion git in the future, it would not work for me :( and I have to make a new link then.
I do it like this because I want to solve my own problem here 13177203. And after search StackOverFlow for a long time, I finally got this solution.
If you are using fish shell instead of bash, you can point to your preferred git binary by adding the following to ~/.config/fish/config.fish.
function git
/usr/local/bin/git $argv;
end

Resources