Generate the App Secret Go to the Github->Setting->Developer Settings->Personal access tokens
Open uPic->Preferences, to add Github as the image bed
Set the github repo information
Prepare Hexo Env
Install Node
There are many ways to install nodes. Most advanced users want to install multiple versions of nodes instead of one version only. To have multiple versions of node installed, I chose to use nvm.
Install nvm via brew
1 2 3 4 5 6
bew install nvm mkdir ~/.nvm #put the following the in the .zshrc export NVM_DIR="$HOME/.nvm" [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"# This loads nvm [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"# This loads nvm bash_completion
To see what Node versions are available to install run
1
nvm ls-remote
Install the LTS
1
nvm install v12.14.0
After installing you can verify what is installed with
Click “Generate new token”, and then confirm your password
Add a token name (you can use a naming convention to help keep track of who has which token if you like) and select your desired scopes/permissions. Basic repo read/write access can be achieved by simply checking the repo box (see below).
Scroll down and click “Generate token”.
Copy the token itself by clicking the blue clipboard. Keep this private! Do not share this token with anyone you don’t want to have access to your repo (I have included the full token in this example for demonstration purposes but I deleted it afterward).
Now change your remote locally. Fire up your local terminal and cd into your local repo directory. Note: if you need to remove the old remote do so now; for example, run a git remote remove origin to remove the origin remote.
Add your new remote in the following format: git remote add origin https://<TOKEN>@github.com/<USERNAME>/<REPO>.git
In my case: https://@github.com/geekdanny/hexo.git
Now run**git remote -v** and you should see something like this:
That’s it! Now try pushing a test commit to ensuring everything is working correctly, and the GitHub warnings should stop.