Home > Enterprise >  Checkout error when trying to clone private github repository (flutter)
Checkout error when trying to clone private github repository (flutter)

Time:08-16

I tried to clone a private repository which I had access, the cloning is success but the checkout were error in windows(it's working fine on linux)

this are the error:

git checkout -q --track origin/master
error: invalid path 'ios/Runner/Assets.xcassets/AppIcon-Prod.appiconset/Prod2021-Icon-40:42-Home-Screen@2x~watch.png'
error: invalid path 'ios/Runner/Assets.xcassets/AppIcon-Prod.appiconset/Prod2021-Icon-40:42-Notification@2x~watch.png'
error: invalid path 'ios/Runner/Assets.xcassets/AppIcon.appiconset/New icon 2-40:42-Home-Screen@2x~watch.png'
error: invalid path 'ios/Runner/Assets.xcassets/AppIcon.appiconset/New icon 2-40:42-Notification@2x~watch.png'
error: The following untracked working tree files would be overwritten by checkout:
 .firebaserc
 .gitignore
 .metadata
 .vscode/launch.json
 .vscode/settings.json
 Makefile
 README.md
 analysis_options.yaml
 android/.gitignore
 android/app/build.gradle
 android/app/google-services.json
 android/app/src/debug/AndroidManifest.xml
 android/app/src/dev/google-services.json
 android/app/src/main/AndroidManifest.xml
 android/app/src/main/ic_launcher-playstore.png
 android/app/src/main/kotlin/com/example/people_lite/MainActivity.kt
 android/app/src/main/res/drawable/launch_background.xml
 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
 android/app/src/main/res/mipmap-hdpi/ic_launcher.png
 android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
 android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
 android/app/src/main/res/mipmap-mdpi/ic_launcher.png
 android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
 android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
 android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
 android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
 android/app/src/main/res/values-night/styles.xml
 android/app/src/main/res/values/ic_launcher_background.xml
 android/app/src/main/res/values/styles.xml
 android/app/src/prd/google-services.json
 android/app/src/prd/ic_launcher-playstore.png
 android/app/src/prd/res/mipmap-anydpi-v26/ic_launcher.xml
 android/app/src/prd/res/mipmap-anydpi-v26/ic_launcher_round.xml
 android/app/src/prd/res/mipmap-hdpi/ic_launcher.png
 android/app/src/prd/res/mipmap-hdpi/ic_launcher_foreground.png
 android/app/src/prd/res/mipmap-hdpi/ic_launcher_round.png
 android/app/src/prd/res/mipmap-mdpi/ic_launcher.png
 android/app/src/prd/res/mipmap-mdpi/ic_launcher_foreground.png
 android/app/src/prd/res/mipmap-mdpi/ic_launcher_round.png
 android/app/src/prd/res/mipmap-xhdpi/ic_launcher.png
 android/app/src/prd/res/mipmap-xhdpi/ic_launcher_foreground.png
 android/app/src/prd/res/mipmap-xhdpi/ic_launcher_round.png
 android/app/src/prd/res/mipmap-xxhdpi/ic_launcher.png
 android/app/src/prd/res/mipmap-xxhdpi/ic_launcher_foreground.png
 android/app/src/prd/res/mipmap-xxhdpi/ic_launcher_round.png
 android/app/src/prd/res/mipmap-xxxhdpi/ic_launcher.png
 android/app/src/prd/res/mipmap-xxxhdpi/ic_launcher_foreground.png
 android/app/src/prd/res/mipmap-xxxhdpi/ic_launcher_round.png
 android/app/src/prd/res/values/ic_launcher_background.xml
 android/app/src/profile/AndroidManifest.xml
 android/app/src/stg/google-services.json
 android/build.gradle
 android/gradle.properties
 android/gradle/wrapper/gradle-wrapper.properties
 android/settings.gradle
 android/settings_aar.gradle
 assets/background/whiteh336.png
 assets/background/[email protected]
 assets/background/[email protected]
 assets/icons/app-icon.png
 assets/images/SplashScreen.png
 assets/msal_auth_config.json
 assets/public_suffix_list.dat
 codecov.yml
 codemagic.yaml
 firebase.json
 ios/.gitignore
 ios/Configuration.storekit
 ios/Flutter/AppFrameworkInfo.plist
 ios/Flutter/Debug.xcconfig
 ios/Flutter/Release.xcconfig
 ios/Podfile
 ios/Podfile.lock
 ios/Runner.xcodeproj/project.pbxproj
 ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
 ios/Runner.xcodeproj/xcshareddata/xcschemes/dev.xcscheme
 ios/Runner.xcodeproj/xcshareddata/xcschemes/prd.xcscheme
 ios/Runner.xcodeproj/xcshareddata/xcschemes/stg.xcscheme
 ios/Runner.xcworkspac
Aborting

i need to work on it using windows because running flutter project on linux is frustating. the vscode and android studio always crashed every 30 minutes and i have to restart the PC. I tried using sourcetree same error. tried download and open it but i can't change branch.

CodePudding user response:

You have two different problems shown here:

  1. Some of the files in the repository are stored with names Windows hates. You cannot check out these commits on Windows.

  2. You have a current commit (a current "checkout", if you want to call it that) and you have made changes to some of the files in your working tree, but not added and committed these changes. Git will refuse to switch to a different commit unless you tell Git please destroy my work.

Your best best for fixing problem #1 is to keep working on Linux (or WSL). Make new commits in which the files no longer have names that Windows cannot support. In particular, four file names contain a colon, e.g.:

Prod2021-Icon-40:42-Home-Screen@2x~watch.png

Windows cannot create files with colons in their names. Rename these files (on the Linux system) so that they do not have colons in their names so that the new names can be created on Windows.

Problem #2 might be caused by other Linux-vs-Windows incompatibilities, including LF vs CRLF, or file-name case issues (Linux can store two separate files README and ReadMe that have different content, or a folder BC/ and another folder bc/ that contain different files; Windows thinks this is one single file, or folder, and gets discombobulated).

  • Related