Tag Archives: git

error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was

If an error is reported in a large project of GIT clone, the data query should be caused by the insufficient default cache size of GIT clone
the solution is to increase the cache space:
git config — global http.postbuffer 1048576000
then an error is reported:
error: RPC failed; Curl 56 gnutls recv error (- 54): error in the pull function.
solution:
change HTTPS protocol to SSH
about to

git clone --branch v0.8.1 https://github.com/pytorch/vision torchvision

Change to

git clone --branch v0.8.1 git://github.com/pytorch/vision torchvision

Git push Submit to Remote Error: “remote: Support for password authentication was removed on August 13, 2021.“

Abnormal

Error reporting for remote submission:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/xxx.git/': The requested URL returned error: 403

reason

From August 13, 2021, GitHub no longer supports submitting codes with passwords.

 

Solution:

Step 1: generate SSH key.

I use a Windows system. Usually, the SSH directory is C: \ users \ administrator \. SSH. If SSH is configured, there will be the following files, where id_ RSA is the private key, ID_ Rsa.pub is the public key.

If SSH is not configured, execute the following command in Git bash to generate SSH key.

ssh-keygen -t rsa -b 4096 -C "Your GitHub Email"

For the options that appear, just default. The first option is the SSH save directory, which can be used by default; In the second option, if you are prompted that SSH already exists, enter y to overwrite and N to not overwrite; The third option is to enter the private key password. If you don’t want to log in with the private key, the private key password is blank. Press enter directly. Press enter twice because the password will be confirmed. After successful generation, you can see the generated key file in the directory.

Step 2: configure to GitHub.

Will ID_ Copy the content in rsa.pub to the newly created SSH keys on GitHub.

Now you can use SSH to clone code and copy SSH links

Git push submission is still unsuccessful

Therefore, it is very important to use SSH link to re clone the warehouse. You need to re clone a remote warehouse to the local.

Just use remote commit again

Reference link: GitHub no longer supports password authentication solution: SSH password free and token login configuration

Support for password authentication was removed on August 13, 2021

Support for password authentication was removed on August 13, 2021

When using git upload to push the local warehouse to the remote server, the following problems occur:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Inaccessible 'https://github.com/LiuXianghai-coder/Study.git/':The requested URL returned error: 403

Since August 13, 2021, the authentication method of user name + password in GitHub has been removed and can only be authenticated by personal access code.

      1. first, you need to create a personal access code, that is,

    persona access tokenfirst, enter the GitHub main interface:

    1. select “meeting”, enter the setting interface:

    1. select “developer meetings” in the navigation column on the left, Enter the developer settings page

    1. select “personal access tokens” and click “generate new token”:

    1. you will see the following interface:

    1.   enter “note” and select “expiration”. You can define the effective time by yourself. If there are no special requirements, check all the check boxes below, and then go to the bottom of the page and click “generate token” to generate the corresponding personal access code

    1. now you can see the generated personal access code. Copy it and save it to a file

      1. use

    personal access token

    1. for authentication

 

    1.   execute the push command again. At this time, you will be prompted to enter the user name. Just enter it normally; After entering the user name, you will be prompted to enter the password. Here, you need to enter the personal access token generated before. You can copy it directly

 

    1.   then you will find that you can push to the local warehouse

 

[Solved] Git push Error: remote: Support for password authentication was removed on August 13, 2021.

An error was reported when pushing the code to GitHub today:

the reason is that GitHub does not support the password authentication scheme, so use personal access token instead.

Solution

Generate token on GitHub

Settings -> Developer Settings -> Personal Access Token -> Generate New Token -> Check – > Click generate token – > Copy the generated token

Change the local certificate to personal access token

Control panel – > Credential manager – > Windows credentials – > Locate git: https://github.com , just change the credentials to the previously generated token.

For other platforms, please refer to support for password authentication was removed. Please use a personal access token instead [duplicate]

[Solved] Git submits locally to the remote warehouse Error: failed to push some refs to…

Today, a new project was created locally and a warehouse was built on the code cloud. You want to push it to the code cloud locally, but git push - U origin master , an error is reported:

 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/xxx/app.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

After searching, use: git pull -- rebase origin master to solve the difference between
rebase and merge:

rebase puts the commit from your current branch at the end of the public branch, so it's called a rebase.
merge merges the public branch with your current commit to form a new commit

Error report after solving git push origin master

After Solving git push origin master , there is an error:

remote: Permission to `USer-A/project.git` denied to `User-B`.
fatal: unable to access `https://github.com/User-A/project.git/`: The requested URL returned error: 403

Environment: git version 2.24.3 (apple git-128)

The user.name I set in Git is the same as the name of GitHub

Solution:

    1. into your own project
cd [project_path]
      1. Edit URL in. Git/config
vim .git/config

You will see the following code block

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
[user]
        name = user-A
        email = [email protected]
[remote "origin"]
        url = https://github.com/User-A/project.git
        fetch = +refs/heads/*:refs/remotes/origin/*

[UNK]
url = https://github.com/User-A/project.git
[email protected]/User-A/project.git

then [UNK] git push origin master,[UNK];

Password for 'https://[email protected]':

Just enter the password

How to Solve Hexo init error: bash: hexo: command not found

Project scenario:

in hexo + GitHub blog deployment, set up and register GitHub account and create warehouse in nodejs and git environment, and then start to set up blog

    1. Run NPM install – G hexo install hexo local environment, enter hexo to check whether the hexo command can be run
    1. (1) create a working folder for saving the local blog myblog
    1. (2) initialize the hexo blog project: hexo init
    1. (3) compile the blog system: hexo g
    1. (4) start the local server for preview: hexo s

If hexo is working properly, enter http://localhost:4000/ You can see the initial appearance of the blog


Problem Description:

after installing the local environment and using git bash in windows, the hexo init command cannot be executed, and the following error is reported: </ font>

bash: hexo: command not found

Cause analysis:

it may be that the NPM environment of node is not well configured. You can try to reinstall node and install it in the default path, or it may not be completely installed when installing with git bash


Solution:

method 1: select the folder where you downloaded the note.js, right-click to open it with git bash, and then enter the command
method 2: open the previously created folder (your blog, mine is blog), hold down shift, right-click, select PowerShell option, open the command prompt, and enter the following command:

after that, a new folder blog will be generated in your folder, which is the content to be deployed

After entering NPX hexo server, you can see that a section of address appears: http://localhost:4000 , you can preview it by typing in your browser

Note: it is recommended to use method 1, because if you use method 2 to deploy successfully, you should use NPX command when writing articles later!!!

Enter passphrase for key ‘/c/Users/**/.ssh/id_rsa‘ [How to Solve]

Create SSH key first

ssh-keygen -t rsa -C "[email protected]"

When generating SSH keys, if you accidentally set the passphrase, you will be prompted Enter passphrase for key '/ C/users/gf115 /. SSH/ID every time git pull and git push are used to clone remote warehouses_ RSA ', you need to manually enter the password every time to continue the operation. You can enter SSH keygen - P on the command line to reset it. Enter directly. If it is blank, there will be no password


then add the public key in Git
here are the specific steps:

insert the ID in. SSH in drive C_ Ras.pub file can be copied to git public key

test it and find that you can clone files in a remote warehouse directly without a password

[Solved] Git pull error: cannot pull with rebase: Your index contains uncommitted changes.

Git pull reports an error
error: cannot pull with rebase: your index contains uncommitted changes.
error: Please commit or stage them

 

Solution:

1. Execute
git stash first

2. Then execute
git pull – rebase

3. Finally, execute
git stash pop


Remember to git stash pop after git stash, otherwise the code will be lost

Git stash: # can be used to temporarily store work in progress
git stash Pop: # read the last saved content from git stack

Push to origin/Master was rejected [How to Solve]

Today, the leader created a new git warehouse for me, and a file readme. MD
already exists in the GIT warehouse. As usual, I operate locally as follows:

git init //Initialize the repository
git add . (file name) //add the file to the local repository
git commit -m "first commit" //add file description information
git remote add origin + remote repository address //link the remote repository and create a master branch
git push -u origin master //Push files from the local repository to the remote repository

But tip:

Reason: readme.md already exists in the new git warehouse, but the files of the local warehouse and the remote warehouse have not been associated. Therefore, we first associate the files of the two warehouses and then submit them
enter the commands in the terminl window of idea

git pull
git pull origin master
git pull origin master --allow-unrelated-histories

Then push the project again to succeed
if you still report an error, you can delete the local. Git folder and re associate the file:


git init //Initialize the repository
git add . (file name) //add the file to the local repository
git commit -m "first commit" //add file description information
git remote add origin + remote repository address //link remote repository, create master branch
#Associate files
git pull
git pull origin master
git pull origin master --allow-unrelated-histories
#push the code to the remote branch
git push -u origin master //Push files from the local repository to the remote repository

[Solved] Zsh: one of the solutions to parse error near ‘\n’

There are unnecessary branches in the remote warehouse. You want to delete them locally

Input command:

git push origin --delete <feature/yuh_add_authority>

feature/yuh_add_authority --- for the remote repository branch name

Then report an error:

zsh: parse error near `\n'

Solution: do not add <>

git push origin --delete feature/yuh_add_authority

Successfully deleted remote warehouse branch: