EDIT
Problem is in the installation bundle flutter_windows_3.3.10-stable.zip installation file on the official page.
Use git to clone latest stable version instead by running the following code in the chosen install directory:
git clone https://github.com/flutter/flutter.git -b stable
Now running "flutter doctor" gives no errors.
Original Question
I have installed flutter by download the zip file from their official website, and when trying to run "flutter doctor" I keep getting errors.
First error before rinning "flutter pub get in flutter_tools:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Next Error:
Failed to find the latest git commit date: VersionCheckError: Command exited with code 128: git -c
log.showSignature=false log HEAD -n 1 --pretty=format:%ad --date=iso
Standard out:
Standard error: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Returning 1970-01-01 01:00:00.000 instead.
Flutter error in doctor summary:
[!] Flutter (Channel unknown, 0.0.0-unknown, on Microsoft Windows [Version 10.0.22621.1105], locale en-DK)
! Flutter version 0.0.0-unknown on channel unknown at C:\Users\USERNAME\AppData\Local\flutter
! Upstream repository unknown
Flutter path:
C:\Users\USERNAME\AppData\Local\flutter\bin
System Enviromental Variable:
User Variables -> Path -> "C:\Users\USERNAME\AppData\Local\flutter\bin"
Flutter Doctor accepts all other parts, such as android toolchain, android studio ...
I have so far not come across a solution, and any help is much appreciated.
Problem is in the installation bundle flutter_windows_3.3.10-stable.zip file on the official page.
Use git to clone latest stable version instead by running the following code in the chosen install directory:
git clone https://github.com/flutter/flutter.git -b stable
Now running "flutter doctor" gives no errors.
Related
I try to update Homebrew as usual. Recently when I issue the command brew update, the following error occurs:
Error: Fetching /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb failed!
The Tap is associated with the software Buck, which I need for development.
I further investigate the issue by following the installation instruction in the Buck official website, I issue the command again:
% brew tap facebook/fb
==> Unshallowing facebook/fb
fatal: couldn't find remote ref refs/heads/master
Error: Failure while executing; `git fetch --unshallow` exited with 128.
Apparently, the Git source has problems. I try to "untap" it:
% brew untap facebook/fb
Error: Refusing to untap facebook/fb because it contains the following installed formulae or casks:
buck
No luck. How can I resolve this problem?
This error is the result of Facebook renaming the branch master to main.
To fix this, first change into Homebrew's local tap folder:
cd /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb
Then, run the following Git commands to update the local repo:
git branch --unset-upstream
git config remote.origin.fetch '+refs/heads/main:refs/remotes/origin/main'
git fetch --prune origin
git branch -m main
git branch -u origin/main
git remote set-head origin -a
Finally, remove the no longer needed master ref (optional):
rm .git/refs/remotes/origin/master
That's it, you should now be able to successfully run brew update.
I am trying to add an existing project to GitHub using the command line. I am in the relevant working directory in the terminal and am trying to use the git init -b main command.
Initially, I was getting an error relating to xcode:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I tried xcode-select --install but the software was unavailable from the update server, so I downloaded 'Command Line Tools for Xcode 12' from https://developer.apple.com/download/more/.
Now on entering git init -b main I am getting the following:
error: unknown switch `b'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]
--template <template-directory>
directory from which templates will be used
--bare create a bare repository
--shared[=<permissions>]
specify that the git repository is to be shared amongst several users
-q, --quiet be quiet
--separate-git-dir <gitdir>
separate git dir from working tree
I am running git version: 2.24.3 (Apple Git-128)
Any help much appreciated!
The -b flag is only available in version 2.28 or later, you need to upgrade your Git.
On debian-based Linux systems such as Ubuntu, do the following:
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt update
sudo apt install git -y
git 2.24 doesn't have option -b/--initial-branch. It was added in git 2.28. You need to upgrade to use the option.
Or, as #matt said, create a repo and then rename the branch:
git init repo
cd repo
git branch -m master slave
prior to git v2.28
git init # ①
git symbolic-ref HEAD refs/heads/main # ②
① After git init, the branch master does not actually exist. Branches get created only when they have at least one commit.
② This updates .git/HEAD to contain ref: refs/heads/main instead of ref: refs/heads/master. Alternatively, git checkout -b main.
git v2.28+
As #phd said, the -b/--initial-branch option was added in git v2.28. git 2.28 also introduces a config option to specify your preferred default branch:
git config --global init.defaultBranch main
Learn more about the new init.defaultBranch setting in GitHub's blog post.
In case you need to install the latest git version (in Ubuntu)
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
Ref: https://gist.github.com/YuMS/6d7639480b17523f6f01490f285da509
This is happening due to the unavailability of a tool called Xcode Select, running xcode-select --install in your terminal fixes these issues with Git not working.
Like mentioned in the topic I updated xcode to version 7.1.1 and osx to version 10.11.1 after that I received errors when trying to compile a project with cocoa pods inside. When I try to run "pod install" I receive:
Creating shallow clone of spec repo master from https://github.com/CocoaPods/Specs.git
[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.
I tried to add the repo manually but then I get:
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master
sh: line 1: 3405 Segmentation fault: 11 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
when I tried to use "git --version" I get:
sh: line 1: 3408 Segmentation fault: 11 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
So I tried to add the PATH manually but i weren't able get it work
my echo $PATH delivers:
/usr/local/mysql/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
and my echo $DYLD_LIBRARY_PATH:
/usr/local/mysql/lib/
Does anyone have a clue how i can fix that problem?
thank you very much :)
Today I had the same error.
1) cd ~/.cocoapods/repos
2) git clone git://github.com/CocoaPods/Specs.git master
(use git protocol, I failed when try to do that via https)
3) pod install --no-repo-update --verbose
I didn't have the exact same issue with cocoapods, but I also got the git error after updating to Xcode 7.1.1 (still on OSX 10.10.5):
error: unable to find utility "git", not a developer tool or in PATH
Simply restarting the terminal fixed the problem for me.
When I try to run brew update, I see: error: The following untracked working tree files would be overwritten by merge:, then a large list of packages, and then I get the error:
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master.
What can I do about this?
Thanks!
Are you installed the beta of El Capitan?
Read this: https://github.com/Homebrew/homebrew/issues/40519
Is it possible to use instaweb on windows?
I have a bare repository at D:/myrepo and I want to use instaweb to see it like
this
I have tried this command
git instaweb --httpd=webrick
But I got this error
git: 'instaweb' is not a git command. See 'git --help'.
Thanks in advance.
The instaweb command is not yet supported for Windows as of version 1.9.0. It's listed under 'Known issues' in the Windows release notes:
Known issues
• Some commands are not yet supported on Windows and excluded from the
installation; namely: git archimport, git cvsexportcommit, git
cvsimport, git cvsserver, git instaweb, git shell.
I got it working using git in MSYS2:
Install MSYS2
Install git:
pacman -S git
Install ruby (webrick is part of Ruby standard library):
pacman -S ruby
You may need to install the CGI.pm perl module using CPAN
And go:
git instaweb -d webrick