Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'git --version' produces a fatal result #17

Open
LancerTony opened this issue Apr 2, 2020 · 2 comments
Open

'git --version' produces a fatal result #17

LancerTony opened this issue Apr 2, 2020 · 2 comments

Comments

@LancerTony
Copy link

Following the instructions on this page to use the WSL git. However, running the git or git --version command on Windows Command Prompt produces the following result:

/mnt/d/DevLib/wslgit-master/wslgit.sh: line 83: cd: C:\Users\tony1: No such file or directory
fatal: can not cd to C:\Users\tony1 (C:\Users\tony1)

mount -t drvfs returns nothing and /etc/wsl.conf has the following:

# [network]
# generateResolvConf = false    

My current Windows version:

Windows 10 Version 2004 
Build 19041.172

Surely there must be something I am missing yes?

@edwardhura
Copy link

I have updated wslgit.dev.sh a little.
First of all mount -t drvfs => return nothing to, it happened after update to 2004.
So I have updated wslgit.dev.sh file.

function get_mounted_drvfs() {
	mount -t 9p | "$AWK" '
	function trim(s) { gsub(/^[ \t]+/, "", s); gsub(/[ \t]+$/, "", s); return s; }
	{
		if(split($0, lr, "type 9p") < 2) next;
		if(split(lr[1], part, "on") < 2) next;

		drive = trim(substr(part[1],1,2));
		mount_to = trim(part[2]);

		print toupper(drive) "\n" mount_to;
	}';
	# endregion need-to-be-replaced-in-unit-test
}

changed all places with drvfs => 9p. And now it works for me. After that, generate new wslgit.sh and change old one.

@hyllus
Copy link

hyllus commented Jun 8, 2020

The fix above that @edwardhura posted worked for me. It wasn't entirely obvious how to generate a new wslgit.sh at first, this is done by runnings ./scripts/gen-wslgit-sh.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants