Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

preface

  • Online music poke me ah!
  • Music blog source code online!
  • Yesterday I suddenly had a conversation with brother B: Evernote MD syntax support is just ok. Typora wrote md Xiang ~
  • I’m used to writing md locally, but I think I might need to read documents when I work from home, and then sync to the online platform.
  • Inner activity: write MD locally with Typora, click the button to upload to the platform.
  • Final decision: Typora + Git management
  • To use Typora, Typora must first support graph beds.
  • The previous Typora drag image generated online | Gitee figure bed articles written, but what seems a bit?
  • Oh ~ originally is a little use process may encounter error handling summary, this, the follow-up to come.
  • Are you ready?

I miss what mom made. I love it.

Usually, when writing notes or blogs, pictures are usually inserted. Since pictures of Typora can only be saved locally, changing pictures will not be accessible, so the existence of a picture bed is needed.

GitHub bed was used initially, but Gitee bed had to be used later due to configuration failure.

PicGo with Gitee chart bed stamping pit process

  • Failed to fetch Authentication Failed – Port

  • “Success” :false – timestamp rename

  • PicGo upload failure Cause and solution -Branch master not found

  • RequestError:Error read ECONNRESET

  • StatusCodeError: 404 – {“message”:”Not Found”}

  • 404 – {” message “:” Not Found Project “}

PicGo using Github map bed?

GitHub Tokens are generated

Log in to the Github home page.

Click on the picture in the upper right corner and select Settings.

After entering Settings, click “Developer Settings” in the lower left corner.

Generate Personal Access Tokens Generate Personal Access Tokens

Fill in the description in [Note], please feel free to fill in, just tick [REPO] below.

Then slide to the bottom and click Generate Token.

Then a Token message will be generated. The generated Token will only appear once. Please copy and save the Token.

1.2 PicGo Setup Github map bed

Open PicGo, open “Bed Settings” on the left, and select “GitHub Bed Settings”.

Parameter Settings:

  • Warehouse name: indicates the address of the remote warehouse, which is in the fixed format of Github user name/warehouse name.

  • Branch name: indicates the branch. Although the default value is “master”, the default value is “main” if it fails. You need to set this value based on your Github branch.

  • Token: Fill in the Token generated in Github, which is the one that the replication saves.

  • Storage path: You can customize a file path.

  • Since the domain name: it is recommended to use https:cdn.jsdelivr.net/gh/Github username/warehouse.

Finally remember [set as default chart bed].

Here, the configuration is complete, go to Typora to try to pull the file past, see if it can be successful oh.

After the second point, it is to analyze the error information and restore the whole process of the pit.

二, Failed to fetch authentication Failed – port

Failed to fetch was reported when uploading images.

Solution: Open “PicGo Settings” and click “Set Server Options”.

Change the port to [36677], which is the default port number recommended by PicGo, and save.

“Success” :false – time stamp rename

If the image is uploaded, success :false is displayed.

Solution: Open [PicGo Settings], open [timestamp rename]

If you try to verify the image upload again, the verification success will be returned, as shown below:

PicGo upload failure cause and solution -Branch master not found

Look at the log error message to see:

[PicGo ERROR] StatusCodeError: 404 - {" message ":" Branch master not found ", "documentation_URL" : "Https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}Copy the code

The solution

Github does not have a master branch, only a main branch, so the name of the branch is changed to main.

RequestError:Error read ECONNRESET

Because sometimes the upload succeeds, sometimes the upload fails, and the configuration stays the same, so what happens? For example, sometimes the following prompt appears

In fact, there are problems with the port and the proxy. In this case, the solution is more violent, open “Set server” again, change the port arbitrarily, for example, change the port to “36688”, ok.

Restart picgo software, upload continues to fail. Then we repeat the operation again, change the port to the original “36677”, ok, and exit the Picgo software completely. Open the Picgo software again.

StatusCodeError: 404 – {“message”:”Not Found”}

Until encountered this error, no matter how Baidu, are in vain, can not find a solution, which made me give up Github map bed.

After abandoning Github, I switched to Gitee. Likewise, Gitee has had its share of problems.

404 – {” message “:” Not Found Project “}

View PicGo’s error log:

------Error Stack Begin------
StatusCodeError: 404 - {"message":"Not Found","documentation_url":"https://docs.github.com/rest"}
    at new StatusCodeError (D:\software\picgo\setup\resources\app.asar\node_modules\request-promise-core\lib\errors.js:32:15)
    at Request.plumbing.callback (D:\software\picgo\setup\resources\app.asar\node_modules\request-promise-core\lib\plumbing.js:104:33)
    at Request.RP$callback [as _callback] (D:\software\picgo\setup\resources\app.asar\node_modules\request-promise-core\lib\plumbing.js:46:31)
    at Request.self.callback (D:\software\picgo\setup\resources\app.asar\node_modules\request\request.js:185:22)
    at Request.emit (events.js:200:13)
    at Request.<anonymous> (D:\software\picgo\setup\resources\app.asar\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:200:13)
    at IncomingMessage.<anonymous> (D:\software\picgo\setup\resources\app.asar\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:288:20)
    at IncomingMessage.emit (events.js:205:15)
-------Error Stack End------- 
Copy the code

Problem solving

404 found no project, apparently failed to connect to the Gitee repository. Read many articles about filling in the gitee warehouse name with the REPO on the Gitee map bed on PicGo. Focus on the warehouse name here!

Incorrect Gitee Settings

The correct

Gitee’s REPO doesn’t just fill out the warehouse, it adds the Gitee account name.

Username/repository.

Try again and it works.

Eight, if there is still a problem, then suggest changing the version

Download PicGO and install it. Stable version 2.2.2 is recommended (29 September 2020)

Github address: github.com/Molunerfinn…

Nine, SM. MS

If you need to use sm.MS map bed, check out this article on Typora’s simple support for map bed

The last

At first, I was also used to write MD locally in the company, but I thought that I might need to read the documents written by the company when I typed code at home, so EVERY time I changed a little document in the company, I had to synchronize it to the online platform. It’s very troublesome.

Now it’s easy to pull and push a document as a Git project. Let Typora support the following bed to solve the problem of image synchronization.

I almost gave up. Before the 2.2.2 version was changed, both Github and Gitee failed to build. However, after the later version was changed, it also succeeded.

Come with me to become excellent!!

If it helps, your likes are my lubricant.

Related literature

Typora+PicGo set GitHub map bed

【Bug】PicGo upload failure cause and solution -Branch master not found

PicGo’s special solution for uploading images to GitHub always fails

404 – {” message “:” Not Found Project “}

Typora configures pictures to be uploaded automatically to the picture bed

PicGo + Github map bed configuration step pit process

Code cloud + PicGO2.2.2 + Typora configuration map bed

Simple and easy to use Typora itself support map bed function

In the past to recommend

Minio unified management files (real JS, JAVA)

Multi-picture detailed explanation, one time to understand the prototype chain (ten thousand words)

Lao Shi said that everything is the object, you also believe?

Vue-cli3 builds the component library

Vue implements dynamic routing (and the interviewer blows project highlights)

Axios manipulation in a project you didn’t know about (Core principles of handwriting, compatibility)

VuePress builds project component documentation

Vue-typescript-admin-template background management system

The original link

Juejin. Cn/post / 702022…