Tag Archives: git

[Solved] Git error: bad signature 0x00000000 fatal: index file corrupt

Git error : bad signature 0x00000000 fatal: index file corrupt

Problem-solving method

Question

After the computer blue screen restarts, resubmit the code prompt bad signature 0x00000000 fatal: index file corrupt

Solution:

Delete the old index file and rebuild the index file
under Windows

# Delete old index files
del .git\index
# Rebuild index file
git reset

Problem-solving

After Vue is packaged to the server, the static resource path reports an error

The error reporting path is:
http: domain name/CSS/XX css

In fact, it should be:
http: domain name/dist/CSS/XX/CSS

Method:
ensure that the value of publicpath is: publicpath: ‘. /’

ps:config.js or Vue-config.js file, according to the actual situation, if the editor cannot be found, search publicpath globally

[Solved] VUE eslint Error: Expected linebreaks to be ‘LF‘ but found ‘CRLF

The reason for this: under Windows environment, GIT will automatically identify the current system environment when we pull the code. Change the original (Linux/Unix) line feed to the corresponding system. When we submit the code, it will be converted to the remote system environment (Linux/Unix), and then install eslint. LF is used by default, so this error will be reported

Line feed format in various environments
window: CRLF (\R \n or ^m \n)
MAC: Cr (\R or ^m)
linux/Unix: LF (\n)

Solution:

1. Manually cut the CRLF at the bottom of the vscode file code into LF, which can only make eslint not report errors for the time being. But in fact, when we pull down again, GIT will automatically convert all files to CRLF, and there will still be an error message

2. Rule configuration in eslint. Turn off line feed verification in the window environment and let it automatically convert CRLF to LF when submitting (it seems that we haven’t fundamentally solved this problem)

"linkbreak-style":["off","windows"]

3. When git pulls the code, let git pull according to the line feed (LF) of the remote code, and no longer convert the format according to the system. At the same time, configure the line feed character of vscode as LF. My approach is to configure the pull format of GIT, delete the whole local original warehouse, and then pull a code remotely again. This is OK. The command is as follows:

git config –global core. Autocrlf has three configurations (depending on the situation, I chose input)

True: automatically convert CRLF to LF when pushing, and CRLF when pulling (this configuration requires configuring eslint to turn off line break verification in window environment)

git config --global core.autocrlf true

Input: CRLF is automatically converted to LF when pushing, but LF is not automatically converted to CRLF when pulling (this configuration does not need to configure eslint, and the code format is consistent with that of the remote. I use this)

git config --global core.autocrlf input

False: no matter push or pull, the original file is what it is

git config --global core.autocrlf false

Other configurations:

1. Reject submission of files containing mixed line breaks

git config --global core.safecrlf true

2. Allow submission of files containing mixed line breaks

git config --global core.safecrlf true

3. Warn when submitting files containing mixed line breaks

git config --global core.safecrlf warn

vscode deployment:

[Solved] Could not resolve placeholder ‘XXX‘ in value “${XXX}“

Problem overview:

The code is determined to be bug-free, but it cannot run after switching to a new environment or git from a remote warehouse.

Development environment:

IDEA

reason:

Because idea may have problems recognizing folder types. Especially when there are many switching spaces, GIT codes and new modules. We just need to set the folder type correctly.

Solution:

Set the Resources folder as a resource folder. If there are problems with other folders, the same is true.

After setting, the folder icon changes, indicating success.

[Solved] git error: unable to create file Filename too long

$ git checkout -b Dev_Br20211217 origin/Dev_Br20211217
error: unable to create file shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/TestAlibabaDubboAnnotationApplication.java: Filename too long
error: unable to create file shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java: Filename too long
error: unable to create file shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java: Filename too long
error: unable to create file shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/TestApacheDubboAnnotationApplication.java: Filenametoo long
error: unable to create file shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java: Filename too long

Solution:
git config --global core.longpaths true

[Solved] ERROR: Command errored out with exit status 128: git clone -q

This error occurred when installing git + GitHub web page. The full name is

Collecting git+https://github.com/pytorch/tnt.git@master
  Cloning https://github.com/pytorch/tnt.git (to revision master) to c:\users\lee\appdata\local\temp\pip-req-build-lbtbze6v
  Running command git clone -q https://github.com/pytorch/tnt.git 'C:\Users\lee\AppData\Local\Temp\pip-req-build-lbtbze6v'
  fatal: unable to access 'https://github.com/pytorch/tnt.git/': OpenSSL SSL_read: Connection was reset, errno 10054
WARNING: Discarding git+https://github.com/pytorch/tnt.git@master. Command errored out with exit status 128: git clone -q https://github.com/pytorch/tnt.git 'C:\Users\lee\AppData\Local\Temp\pip-req-build-lbtbze6v' Check the logs for fu
ll command output.
ERROR: Command errored out with exit status 128: git clone -q https://github.com/pytorch/tnt.git 'C:\Users\lee\AppData\Local\Temp\pip-req-build-lbtbze6v' Check the logs for full command output.

Solution:

 pip install git+git://github.com/ildoonet/pytorch-gradual-warmup-lr.git

Successfully installed

Collecting git+git://github.com/ildoonet/pytorch-gradual-warmup-lr.git
  Cloning git://github.com/ildoonet/pytorch-gradual-warmup-lr.git to c:\users\lee\appdata\local\temp\pip-req-build-ncz3svwe
  Running command git clone -q git://github.com/ildoonet/pytorch-gradual-warmup-lr.git 'C:\Users\lee\AppData\Local\Temp\pip-req-build-ncz3svwe'
  Resolved git://github.com/ildoonet/pytorch-gradual-warmup-lr.git to commit 6b5e8953a80aef5b324104dc0c2e9b8c34d622bd
Building wheels for collected packages: warmup-scheduler
  Building wheel for warmup-scheduler (setup.py) ... done
  Created wheel for warmup-scheduler: filename=warmup_scheduler-0.3.2-py3-none-any.whl size=3917 sha256=4cef133c28685f1e5a70364fd6546a3d4d995fe49584781b1024d3707f9f222f
  Stored in directory: C:\Users\lee\AppData\Local\Temp\pip-ephem-wheel-cache-m6_t0cfl\wheels\d2\57\4d\3adb5d109151933485f2b4387f61a90ff8e669f50fc8f1fa14
Successfully built warmup-scheduler
Installing collected packages: warmup-scheduler
Successfully installed warmup-scheduler-0.3.2

[Solved] cocopod Error: failed: undefined method `map‘ for nil:NilClass

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command


/usr/local/bin/pod install


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack


   CocoaPods : 1.8.4
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 11.3.1 (11C504)
         Git : git version 2.19.0
Ruby lib dir : /Users/huanghaipo/.rvm/rubies/ruby-2.6.3/lib
Repositories : HPSpecs - git - https://github.com/HuangHaiPo/HPSpecs.git @ 87ca8ef48b56269780abb0e14211ca1f2e121217
               HuModularizationSpecs - git - [email protected]:HuModularizationLibrary/HuModularizationSpecs.git @ cd28555226d424e50e8e7454c3a8a5b287e4b9f2
               master - git - https://github.com/CocoaPods/Specs.git @ 061335ab06da5c1f542cdb56bc0d73f9af2d1984




### Podfile

ruby
source 'https://github.com/CocoaPods/Specs.git'

# Uncomment this line to define a global platform for your project
 platform :ios, '9.0'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
pe=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

Solution:

Execute the following command to update the local library. If the version is low, upgrade cocoapods

pod repo update
upgrade
sudo gem update --system
sudo gem install cocoapods
pod setup

Vs code execute command error [How to Solve]

Inexplicable mistake about vs Code

Error Description:

Drive not found. If you enter any execution command in the vs Code terminal, you will report “drive not found”. The name is’ ‘ The drive for ‘C’ does not exist.

Solution:

    1. download the cmder plug-in in vs Code

    1. modify the default terminal

 

    1. steps: File —— preferences —— settings —— search shell —— Click to enter the file

"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe"

Note out and replace with:

"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.env.windows": {"CMDER_ROOT": "[cmder_root]"},
"terminal.integrated.shellArgs.windows": ["/k", "[cmder_root]\\vendor\\init.bat"],

As shown in the figure:
4 Save exit, restart vs Code

[Solved] git review Error: UnicodeDecodeError: ‘gbk‘ codec can‘t decode

The error message is similar to:

UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xac in position 44: illegal multibyte sequence

Solution:
find the python installation directory or directly search the subprocess Py, find the installation place. Python 38-32\lib\ has a file subprocess Py, encoding = none is changed to encoding = ‘UTF-8’.

error: src refspec master does not match any [How to Solve]

Summary

Solve the problem in one sentence:

Enter first

git push -u origin main

Then enter

 git config http.sslVerify "false"

Then enter

git push -u origin main

Problem background

When uploading a project to GitHub, enter the command:

git push -u origin master

report errors:

error: src refspec master does not match any

First attempt to solve

I found an answer on the Internet:

git push -u origin main

Error is still reported after input:

OpenSSL SSL_read: Connection was reset, errno 10054

Try again

Another answer was found:

 git config http.sslVerify "false"

No error is reported
Enter again:

git push -u origin main

The screenshot below shows that the upload was successful