gpt4 book ai didi

javascript - react native git 升级错误 : fatal: No remote repository specified

转载 作者:行者123 更新时间:2023-12-05 07:40:06 35 4
gpt4 key购买 nike

我在尝试使用 react-native-git-upgrade 升级时遇到问题。第一期与https://github.com/facebook/react-native/issues/11578相同.

不幸的是,该线程上的解决方案都没有帮助我。

所以,我试图清除 yarn 缓存。我运行 yarn cache clean

当我再次尝试运行 react-native-git-upgrade 时,出现此错误:

E:\ReactProject\Aurai>react-native-git-upgrade

git-upgrade info Check for updates
git-upgrade info Using yarn 0.24.5
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade info Check React peer dependency
git-upgrade info Check that Git is installed
git-upgrade info Get information from NPM registry
git-upgrade info Upgrading to React Native 0.48.4, React 16.0.0-alpha.12
git-upgrade info Setup temporary working directory
git-upgrade info Configure Git environment
git-upgrade info Init Git repository
git-upgrade info Add all files to commit
warning: LF will be replaced by CRLF in .babelrc.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .buckconfig.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .flowconfig.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in __tests__/index.android.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in __tests__/index.ios.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/proguard-rules.pro.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/assets/index.android.bundle.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/java/com/auraiid/id/MainActivity.java.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/java/com/auraiid/id/MainApplication.java.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/gradle/wrapper/gradle-wrapper.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/gradlew.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/keystores/BUCK.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/keystores/debug.keystore.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in index.android.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in index.ios.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId-tvOS/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId-tvOSTests/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId.xcodeproj/xcshareddata/xcschemes/AuraiId-tvOS.xcscheme.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId.xcodeproj/xcshareddata/xcschemes/AuraiId.xcscheme.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/AppDelegate.h.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/Base.lproj/LaunchScreen.xib.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/Images.xcassets/AppIcon.appiconset/Contents.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/main.m.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiIdTests/AuraiIdTests.m.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiIdTests/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Badge.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Button.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Card.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/CardItem.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/CheckBox.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Container.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Content.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Fab.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Footer.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/FooterTab.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Form.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/H1.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/H2.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/H3.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Header.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Icon.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Input.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/InputGroup.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Item.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Label.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/ListItem.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Picker.android.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Picker.ios.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Radio.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Segment.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Separator.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Spinner.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Tab.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/TabBar.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/TabContainer.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/TabHeading.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Text.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Textarea.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Title.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/Toast.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/View.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/components/index.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/variables/commonColor.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/variables/material.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in native-base-theme/variables/platform.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
git-upgrade info Commit current project sources
git-upgrade info Create a tag before updating sources
git-upgrade info Generate old version template
git-upgrade info Add updated files to commit
warning: LF will be replaced by CRLF in .babelrc.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .buckconfig.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .flowconfig.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/BUCK.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/build.gradle.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/proguard-rules.pro.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/AndroidManifest.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/res/values/strings.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/res/values/styles.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/build.gradle.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/gradle.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/gradle/wrapper/gradle-wrapper.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/gradlew.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/keystores/BUCK.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/keystores/debug.keystore.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/settings.gradle.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId-tvOS/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId-tvOSTests/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId.xcodeproj/xcshareddata/xcschemes/AuraiId-tvOS.xcscheme.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId.xcodeproj/xcshareddata/xcschemes/AuraiId.xcscheme.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/AppDelegate.h.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/AppDelegate.m.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/Base.lproj/LaunchScreen.xib.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/Images.xcassets/AppIcon.appiconset/Contents.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiId/main.m.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiIdTests/AuraiIdTests.m.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ios/AuraiIdTests/Info.plist.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/java/com/auraiid/MainActivity.java.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in android/app/src/main/java/com/auraiid/MainApplication.java.
The file will have its original line endings in your working directory.
git-upgrade info Commit old version template
git-upgrade info Install the new version
error Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: C:\Users\Ando\AppData\Local\Yarn\cache\v1\.tmp\a3450fedabcb67009ae55c8f322f57b0
Output:
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add react-native@0.48.4 react@16.0.0-alpha.12' exited with code 1:
stderr: undefinederror Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: C:\Users\Ando\AppData\Local\Yarn\cache\v1\.tmp\a3450fedabcb67009ae55c8f322f57b0
Output:
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

stdout: yarn add v0.24.5
[1/4] Resolving packages...
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

at ChildProcess.child.on.code (C:/Users/Ando/AppData/Roaming/npm/node_modules/react-native-git-upgrade/cliEntry.js:58:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
git-upgrade ERR! Restore initial sources
Note: checking out 'project-snapshot'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b <new-branch-name>

HEAD is now at adaaa8d... Project snapshot

我该怎么办?

我当前的 React Native:0.44.0

git 版本 2.13.1.windows.2

yarn 版本​​ 0.24.5

最佳答案

在我的例子中,我的后端有一个服务器文件夹,我不小心在该文件夹上创建了一个 git init 或初始 git repo,然后我试图将代码推送到我的主文件夹或根文件夹,因为该服务器文件夹的 git repo 我的主/根文件夹给我错误,如“文件有工作目录,LF 将被 CRLF 替换”等。所以我只是从根文件夹和服务器文件夹中删除了 git repo 或 .git,然后重试它和这个它起作用的时间。

检查你的文件夹是否有任何文件夹有 git repo init 或者你是否在像我这样的任何文件夹上运行 git init 代码 xD。 如果您想完全删除一个 git 存储库,请使用以下命令:

rm -rf .git(-rf 将强制删除 git 仓库)

试试这个,然后推送或升级 git...

希望对您有所帮助。 :)

关于javascript - react native git 升级错误 : fatal: No remote repository specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46477595/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com