Tag Archives: git

Git Error: Unable to create ‘D:/xxx/.git/index.lock’: File exists. Another git process seems to be running in this repository, e.g.an editor opened by ‘git commit’. Please make sure all p

Unable to create ‘D:/xxx/. git/index. lock’: File exists.
Another git process seems to be running in this repository, e.g.an editor opened by ‘git commit’.
Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier:
remove the file manually to continue.
Pull operation failed.

 

Cause analysis:

The index.lock file under .git is automatically generated when some time-consuming git operations are performed, and is automatically deleted when the operation is finished. Sometimes when you force a git operation in progress to close, the file is not automatically deleted, so you can’t do other git operations afterwards and must delete it manually.

 

Solution:

Method 1: find git/index.lock file and delete it directly
If Linux, execute the RM delete command: rm -f .git/index.lock

Method 2: execute git command: git clean -f .git/index.lock

[Solved] Git Error: failed: authentication failed for ‘http: XXXX.git / ”

When you enter the user name and password incorrectly in the clone on git, the window for entering the user name and password will no longer pop up automatically. The errors are as follows:

fatal: Authentication failed for 'http:xxxx.git/''

After some Baidu found a solution, just input

git config --system --unset credential. helper

Then press enter, enter the URL of GIT clone copy, and then press enter

At this time, the command line will appear asking for the user name, then enter your git user name and press enter

Next, a small window will pop up, prompting you to enter your password, enter your git password, and click OK

[Solved] Git clone Error: fatal: Protocol ‘HTTPS’ is not supported

Git problem: git clone encountered fatal: Protocol ‘HTTPS’ is not supported problem solution

Reappearance

An error is reported when the clone command is executed in Git bash in Windows protocol ''https'' is not supported

reason

When pasting the address, we use Ctrl + V, which has no effect in Git bash. Then we will use paste in the right-click menu, but unfortunately, using Ctrl + V will add a hidden symbol ^?In Git Bash.

In Git bash, your clone statement may display as normal:

git clone https://gitee.com/qianfanguojin/homework_1.git

But the real statement is as follows:

git clone ^?https://gitee.com/qianfanguojin/homework_1.git

There are more symbols in front of the link, and the protocol becomes ^ HTTPS, which must not be cloned successfully, indicating that the protocol is not supported.

Solution:

Delete the space before HTTPS, and enter the space manually

Git Upload File Error: fatal: could not read from remote repository. [How to Solve]

problem

git push  – An error is reported after the U origin master is executed

fatal: Could not read from remote repository.

Solution

1. Git execution

git remote add origin [email protected]:username/xxx.git

2. Open the .ssh folder

Find the  id_rsa.pub file

3. Open GitHub’s Settings

Select SSH KEYS settings, click the New SSH key button

Open the id_rsa.pub file with Notepad, copy all the content to the Github key, and click the add ssh key button.

others:

If the error is not resolved, try resetting the SSH key

ssh-keygen -t rsa -C "github账号"

1. Open the .shh  folder, the newly generated id_rsa, id_rsa.pub two files and the new Key

2. Open the Settings of github and set the ssh key (repeat the above steps to add new SSH key )

SSL certificate problem in Git: unable to get local issuer certificate error

This is because when you access git remote warehouse through HTTPS, GIT will report an error if the SSL certificate on the server is not authenticated by a third-party authority. The reason is that unknown unsigned certificates mean that there may be a great risk. The solution is to turn off SSL verify in Git with the following command

This command affects the current user of the system

git config –global http.sslverify false

If you want to set all users globally, you can change it to this:

git config –system http.sslverify false

If you only want to set for the current warehouse, you can execute it under the warehouse directory to be modified

git config http.sslverify false

Modified git configuration C: \ program files \ git \ etc:

 

 

Turn: https://www.cnblogs.com/jaxu/p/12027839.html

 

git Error: remote: Support for password authentication was removed on August 13, 2021.

1. Problem background

When submitting code using git, the following errors are found:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

It means that user name and password authentication is no longer supported since August 13, 2001, and a personal access token needs to be created

2. Problem solving

① Click the avatar and select settings


② Select developer settings in the left column


③ Select personal access tokens in the column


④ Click generate new token


⑤ Fill in options

If you only use it for yourself, you can directly choose an unlimited validity period

In addition, you can check all the following permissions for convenience, and then click the last generate token to generate a token


⑥ Copy the generated token and save it


⑦ Modify the URL of the existing item (note that when copying this instruction, after changing the Chinese character to the corresponding content, delete the brackets)

git remote set-url origin https://<Your token>@github.com/<your git username>/<repository name to be modified>.git

Git is used and an error is reported. Author identity unknown solution

Git needs to set user.name and user.email when it is first used, otherwise the error author identity unknown will be reported when git command is used. The specific setting steps are as follows:

git config --global user.name 'your name'
git config --global user.email 'your email'

After setting, you can use the following commands to view the setting results;

git config --list

Indicates that the setting is successful; Use at this time

git commit -m 'description'

It’ll be all right when you’re ready.

Git pull code authentication failed with error: fatal: authentication failed for “XXXX”

The main reason for this problem is that the account and password are wrong

The solution is very simple. Open your git bash here on the project, and then enter git config — System — unset credential.helper. After exiting, pull the project again. You will be asked to enter your account and password. Enter it and it will be OK

If the problem has not been solved, it means that there is a problem with your account and password. Check whether the account and password are entered incorrectly and whether the password has expired. My problem is that the password has expired and needs to be reset

If not, open the control panel – user account – credential manager – manage windows credentials – normal credentials (delete all), and then repeat the above operation. OK! everything will be fine!

Git Error: fatal protocol error bad pack header [How to Solve]

In the process of using git, fatal: protocol error: bad pack header always appears, which makes git unable to update and upload. See the following for specific error reports:

fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header

Try many ways online, such as the following:

git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1"

I’ve tried to think it’s a version problem, but check my git version. Centos7 uses Yum to install the same version.

None of them have been solved.

So I looked at the memory. Although it was still enough, there was no other way. So I upgraded the machine from 1c4g to 1c8g. After the upgrade, the problem was solved.

It seems that there is still not enough memory. It may be solved by restarting and releasing memory, but there is no attempt here

Git submits the code to the remote warehouse with an error: fatal: remote origin already exists

problem

When adding a remote GitHub repository using git, you will be prompted with an error: fatal: remote origin already exists  , As shown in the figure below:

resolvent

1. Delete the remote git warehouse first:

$ git remote rm origin

2. Add the remote git warehouse again:

$ git remote add origin [email protected]:FBing/java-code-generator

However, if an error is reported when git remote RM origin is executed, we need to manually modify the contents of the gitconfig file:

$ vi .git/config

As shown in the figure below:

Just delete the line [remote “origin”].