【Hexo博客搭建】将其部署到GitHub Pages(二):如何初始化并部署?

2023-10-27

系列目录

【Hexo博客搭建】将其部署到 GitHub Pages(一):前期要做哪些准备?

【Hexo博客搭建】将其部署到 GitHub Pages(二):如何初始化并部署?

【Hexo博客搭建】将其部署到 GitHub Pages(三):怎么写作以及更新?

简介: 本系列文章属于半笔记半教程的零基础小白入门文,教你将 Hexo 部署到 GitHub Pages 的前期需要做哪些准备,跟着此系列文章最终可以获得自己的静态博客网站。流程很长,分成不同的篇幅,此为本系列的第二篇。

前言

​ 本系列文章属于半笔记半教程的零基础小白入门文,教你将 Hexo 部署到了 GitHub Pages,从而获得自己的静态博客网站。流程很长,分成不同的篇幅,此为本系列的第二篇。

步骤

六、初始化 Hexo 工程

注意:接下来应该是你自己的自定义的目录,请不要完全复制粘贴我的!

比如说我是Windows用户,想把我的网站代码储存在

电脑 E 盘的 Hexo 文件夹下

那么我要先在E盘建立相应的文件夹,然后再继续操作。

由于cmd终端最开始默认在C盘操作,我得先切换到E盘,那么我要输入 E: 然后回车,即:

Microsoft Windows [版本 10.0.19042.1165]
(c) Microsoft Corporation。保留所有权利。

C:\Users\10272>E:

E:\>

然后此时,我要通过 cd 进入我本地电脑打算存储网站代码的文件夹目录。(或者右键文件夹 Git Bash Here),即 Hexo 文件夹里

也就是说我需要输入 cd Hexo 然后回车,我会看到:

E:\>cd Hexo

E:\Hexo>

好了成功进入,接下来输入下方代码,再按回车:

hexo init blog

hexo :正是因为我们之前安装了 hexo-cli 这一个包,所以我们可以在终端中使用 hexo 这一命令。

init :用来初始化博客的模版文件。后面跟的是你要新建的文件夹比如我的是:blog

然后我会看到

E:\Hexo>hexo init blog
INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
[32mINFO [39m Install dependencies
added 242 packages from 207 contributors in 105.871s
15 packages are looking for funding
  run `npm fund` for details
INFO  Start blogging with Hexo!
E:\Hexo>

下面通过 cd 进入我的博客文件夹,

即输入 cd blog 后按回车,我会看到:

E:\Hexo>cd blog
E:\Hexo\blog>

现在我就是处于 E:\Hexo\blog 文件夹下操作了,

现在在这个文件夹内默认安装所有 package.json 文件中提到的包,

即输入 npm install 然后回车,我会看到:

E:\Hexo\blog>npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
audited 243 packages in 4.956s
15 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
E:\Hexo\blog>

这时候,我的 blog 文件夹里面会多出一堆文件,

文件夹结构应该大致是这样:

.
├── config.yml
├── package.json
├── scaffolds
├── source
|  ├── _drafts
|  └── _posts
└── themes

现在我们输入 hexo server 然后回车,会看到:

E:\Hexo\blog>hexo server
INFO  Validating config
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

server 代表开启本地的 Hexo 服务器,这时你就可以打开浏览器,在地址栏中输入 localhost:4000 就可以看到本地的网页了。

在这里插入图片描述

这个网页就是Hexo为你自动生成的博客页面。

Ctrl+C 中断服务器的运行,

系统提示 终止批处理操作吗(Y/N)? 输入 Y 然后回车。

至此,基础的模版页面便已经搭建好了。

七、生成静态文件

到现在,我们的工作都是在本地进行,想必你也很想放到线上与小伙伴们分享。这便轮到了 GitHub Pages 的出场,不过 GitHub Pages 只支持纯静态文件。

所以我们需要使用下面一行命令先来生成站点的静态文件。

(如果进行多次生成,为了避免受错误缓存影响,最好使用 hexo clean 先清除一遍。)
hexo generate
(上方命令也可以缩写为 hexo g)

输入后回车,我会看到:

E:\Hexo\blog>hexo g
INFO  Validating config
INFO  Start processing
INFO  Files loaded in 209 ms
INFO  Generated: archives/index.html
INFO  Generated: archives/2021/index.html
INFO  Generated: archives/2021/08/index.html
(node:20772) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:20772) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:20772) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:20772) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:20772) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:20772) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
INFO  Generated: index.html
INFO  Generated: fancybox/jquery.fancybox.min.css
INFO  Generated: js/script.js
INFO  Generated: 2021/08/25/hello-world/index.html
INFO  Generated: css/style.css
INFO  Generated: css/fonts/fontawesome-webfont.woff2
INFO  Generated: css/fonts/fontawesome-webfont.woff
INFO  Generated: fancybox/jquery.fancybox.min.js
INFO  Generated: css/fonts/fontawesome-webfont.ttf
INFO  Generated: css/fonts/FontAwesome.otf
INFO  Generated: css/fonts/fontawesome-webfont.eot
INFO  Generated: js/jquery-3.4.1.min.js
INFO  Generated: css/images/banner.jpg
INFO  Generated: css/fonts/fontawesome-webfont.svg
INFO  17 files generated in 1.98 s
E:\Hexo\blog>

此时我的文件夹目录下会出现 public 这个文件夹,里面存放的就是我的站点的静态文件。

八、与远程仓库建立关联

接下来我们将本地的仓库与此前在 GitHub 上建立的仓库建立关联。

输入 git init 初始化 Git 仓库,只需要执行一次即可,看到:

E:\Hexo\blog>git init
Initialized empty Git repository in E:/Hexo/blog/.git/

在将其部署到 GitHub Pages 上之前,我们最好先建立一个分支。

什么是分支?

Git 提供了版本管理功能,其中还有一个分支功能,你现在可以简单地将其理解为平行世界。

用户名.github.io 部署后,GitHub Pages 将默认使用你的 main分支(以前叫 master分支,一个意思,主要分支的意思)作为静态文件部署。所以我们最好新建一个 hexo 分支(命名无所谓)用来存储 Hexo 地源代码,main 分支则用来存储部署后的静态文件。为了方便,不想其他名字了,这个分支我就起名叫 hexo 吧。

新建该分支的命令语句是 git checkout -b hexo ,然后回车,可以看到:

E:\Hexo\blog>git checkout -b hexo
Switched to a new branch 'hexo'
E:\Hexo\blog>

这时便成功建立了一个 hexo 分支。(此后的工作都将在 hexo 分支下进行)

你可以通过 git branch -v 来查看当前有哪些分支,使用 git checkout 分支名 来切换到对应的分支。

Git 学习笔记

九、部署到 GitHub Pages

为了更方便的部署到 GitHub Pages,Hexo 提供了 hexo-deployer-git 插件。

老规矩,安装该插件,要输入下面命令,

npm install hexo-deployer-git --save

回车后可以看到

E:\Hexo\blog>npm install hexo-deployer-git --save
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ hexo-deployer-git@3.0.0
added 1 package from 1 contributor and audited 244 packages in 8.166s
15 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
E:\Hexo\blog>

下面对 blog 文件夹下的 _config.yml 文件进行配置。

右键 _config.yml ,打开方式选VS Code(或者直接用VS Code打开该文件),

滑到最下面,把关于

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:' '

的这段代码补充为

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: https://github.com/aizhiqian/aizhiqian.github.io.git   #仓库地址
  branch: main  # 默认使用 master 分支(Github现在改名为main分支)
  message: Update Hexo Static Content # 你可以自定义此次部署更新的说明说明

Ctrl+S保存,退出VS Code,部署!

终端里输入命令 hexo deploy 后(或者缩写为 hexo d )回车,我的电脑显示:

E:\Hexo\blog>hexo deploy
INFO  Validating config
INFO  Deploying: git
INFO  Setting up Git deployment...
Initialized empty Git repository in E:/Hexo/blog/.deploy_git/.git/
Author identity unknown
*** Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got '10272@DESKTOP-N3PNS7C.(none)')
FATAL {
  err: Error: Spawn failed
      at ChildProcess.<anonymous> (E:\Hexo\blog\node_modules\hexo-util\lib\spawn.js:51:21)      at ChildProcess.emit (events.js:400:28)
      at ChildProcess.cp.emit (E:\Hexo\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
    code: 128
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
E:\Hexo\blog>

是的,部署出错(FATAL)了,“ Please tell me who you are.”

原来是创建git文件夹的时候信息不完善导致的,

它提示我需要运行(Run)下面两行程序,来设置我帐户的默认标识。

git config --global user.email “you@example.com”

git config --global user.name “Your Name”

注意双引号前有空格,邮箱随便填也可以,比如QQ邮箱啥的,

我用的这个邮箱查找路径是:点击Github主页右上角头像,点击settings,点击Emails,然后就能找到Github的这个邮箱了

那么我分别输入这两个命令按回车,可见下方代码:

E:\Hexo\blog>git config --global user.email "你的邮箱"
E:\Hexo\blog>git config --global user.name "用户名"
E:\Hexo\blog>

再用命令 *git config -l* 查看所有的配置信息

E:\Hexo\blog>git config -l
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=E:/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
user.email=你的邮箱
user.name=用户名
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
E:\Hexo\blog>

可以看见下面这两条信息,代表信息以及完善上去了

user.email=你的邮箱

user.name=用户名

那我们接着部署吧!

终端里输入命令 hexo deploy 后(或者缩写为 hexo d )回车,我的电脑再次报错:

E:\Hexo\blog>hexo deploy
INFO  Validating config
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
warning: LF will be replaced by CRLF in 2021/08/25/hello-world/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2021/08/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2021/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/fonts/fontawesome-webfont.svg.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/style.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in fancybox/jquery.fancybox.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/jquery-3.4.1.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/script.js.
The file will have its original line endings in your working directory
[master (root-commit) a9fc5f8] Update Hexo Static Content
 17 files changed, 5174 insertions(+)
 create mode 100644 2021/08/25/hello-world/index.html
 create mode 100644 archives/2021/08/index.html
 create mode 100644 archives/2021/index.html
 create mode 100644 archives/index.html
 create mode 100644 css/fonts/FontAwesome.otf
 create mode 100644 css/fonts/fontawesome-webfont.eot
 create mode 100644 css/fonts/fontawesome-webfont.svg
 create mode 100644 css/fonts/fontawesome-webfont.ttf
 create mode 100644 css/fonts/fontawesome-webfont.woff
 create mode 100644 css/fonts/fontawesome-webfont.woff2
 create mode 100644 css/images/banner.jpg
 create mode 100644 css/style.css
 create mode 100644 fancybox/jquery.fancybox.min.css
 create mode 100644 fancybox/jquery.fancybox.min.js
 create mode 100644 index.html
 create mode 100644 js/jquery-3.4.1.min.js
 create mode 100644 js/script.js
fatal: unable to access 'https://github.com/Barry-Flynn/blog/': OpenSSL SSL_read: Connection was reset, errno 10054
FATAL {
  err: Error: Spawn failed
      at ChildProcess.<anonymous> (E:\Hexo\blog\node_modules\hexo-util\lib\spawn.js:51:21)      at ChildProcess.emit (events.js:400:28)
      at ChildProcess.cp.emit (E:\Hexo\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
    code: 128
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
E:\Hexo\blog>

又报错了?我很晕。问了群里大佬,说可能是国内的墙导致的网络问题。好吧,免费的那个什么软件工具果然不太靠谱。解决该问题并重新连接后第三次输入命令 hexo deploy ,回车

E:\Hexo\blog>hexo deploy
INFO  Validating config
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
warning: LF will be replaced by CRLF in 2021/08/25/hello-world/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2021/08/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2021/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/fonts/fontawesome-webfont.svg.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/style.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in fancybox/jquery.fancybox.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/jquery-3.4.1.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/script.js.
The file will have its original line endings in your working directory
On branch master
nothing to commit, working tree clean
info: please complete authentication in your browser...
Enumerating objects: 31, done.
Counting objects: 100% (31/31), done.
Delta compression using up to 4 threads
Compressing objects: 100% (25/25), done.
Writing objects: 100% (31/31), 882.21 KiB | 4.98 MiB/s, done.
Total 31 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), done.
To https://github.com/Barry-Flynn/blog
 + 4b62927...a9fc5f8 HEAD -> main (forced update)
Branch 'master' set up to track remote branch 'main' from 'https://github.com/Barry-Flynn/blog'.
[32mINFO [39m Deploy done: [35mgit[39m
E:\Hexo\blog>

成功了!Ohhhhhhhhhhh~

等待完成后,打开网址 https://用户名.github.io 就能看到你的线上网站了!

使用 https,http 可能无法正常打开。HTTPS 是多了安全加密的 HTTP,Chrome 浏览器已经默认会显示 http 链接为不安全。

为了安全,建议开启强制 https 跳转。项目地址页面 -> Settings -> Options -> GitHub Pages -> Enforce HTTPS。(翻到下面)

此时,http 网址会自动重定向到 https

十、备份与自动部署

我们当前只是将生成的静态文件部署到了云端。

为了以防万一,我们应该将网站的源代码文件也推送到 GitHub 仓库备份。

输入下方代码按回车,与远程 Git 仓库建立连接,只此一次即可

git remote add origin https://github.com/用户名/用户名.github.io

若输入错误,可以运行输入 git remote rm origin 删除远程地址,

然后再输入一遍正确的命令与远程 Git 仓库建立连接,之后就行了。

接下来准备提交,这三句命令将是你以后每次备份所需要输入。

(括号内为注释,不用输入哈!)

(添加到缓存区)
git add .
(这次做了什么更改,简单描述下即可)
git commit -m 'backup'
(第一次提交时,你可能需先运行下面命令设置一下默认提交分支)
(git push --set-upstream origin hexo)
(推送至远程仓库)
git push

之后写文章可以在该项目下写,与之前一样,只不过这里同时管理了两个分支。

main -负责展示静态网页

hexo -备份本地hexo文件

main分支更新

hexo d

hexo分支更新

git add . #添加所有文件到暂存区
git commit -m "新增博客文章"  #提交
git push origin hexo #推送hexo分支到Github

总结

好了,这就是本篇文章:

【Hexo博客搭建】将其部署到 GitHub Pages(二):如何初始化并部署?

的全部内容了,更多内容会很快写出来,尽情期待。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【Hexo博客搭建】将其部署到GitHub Pages(二):如何初始化并部署? 的相关文章

  • “git merge --squash”的正确用例是什么?

    有些人喜欢git merge squash由于以下原因 压缩到单个提交使您有机会清理混乱的 WIP 提交 并为您要合并的更改提供良好的理由 https coderwall com p qkrmjq git merge squash http
  • 在功能分支上运行测试

    我有一个构建配置 其中包含连接到 git 分支的测试 VCS 根dev 3 个构建步骤和 1 个触发器 这些是我的构建步骤 构建测试 运行测试 构建和部署 我想为分支运行所有这些构建步骤dev但只有其中两个 构建和运行测试 用于分支匹配fe
  • 如何将 git-svn 与 svn+ssh url 一起使用

    我喜欢在cygwin中使用git svn clone使用我们公司 svn 存储库的命令 这个的网址是svn ssh svn
  • git filter-repo:它可以在特定分支上使用吗?

    我正在读什么git filter repo可以做 因为我想用它做一个小实验 我有这个存储库 我只想从中获取一个目录的历史记录 比如说 master 但我不想为主人工作 我想创建一个新分支 例如filter repo test然后让git f
  • 运行 flutter doctor 吐出错误:标准错误:致命:坏对象 HEAD

    我已经从官方网站安装了 Flutter 和 Android Studio 我是 Git GitHub 移动开发和 Android 开发的新手 我试图在命令提示符 Windows 10 中运行 flutter doctor 命令 但是 它会以
  • git update-index --no-assume-unchanged 不起作用

    我设置了assume unchanged咬了几个文件 现在我想取消它们 但这不起作用 gt git update index no assume unchanged Gemfile gt git ls files v grep Gemfil
  • 如何与其他用户共享 bitbucket 存储库?

    我正在使用 Bit 存储桶 并且我想与一位朋友分享我的存储库 我用的是免费的个人账户 似乎有一个选项可以在位桶中创建团队 但它说它将把我的帐户从个人帐户转换为团队帐户 我不要那个 我如何授予其他用户访问此存储库的权限 有一个共享链接选项 如
  • 如何防止克隆我的 github 存储库?

    我正在尝试找到一种方法来防止从 github 存储库克隆 例如 我有一个私有存储库 有些人在该存储库中工作 在公司计算机中 团队中的每个人都设置了授权级别 当我在 github 上为某个用户设置授权时 该存储库可在他 她自己的 github
  • 如何将一个文件存储库上传到 Gist,并保留历史记录?

    我的计算机上有一个包含单个文件的 Git 存储库coins py 我如何才能将其作为 Github 上的要点来保存历史 这其实很简单 您可以将现有历史记录移动到 Gist 存储库中 就像将其移动到任何其他存储库中一样 创建要点 只需输入一些
  • git tag --contains 如何工作?

    从几天前开始 我一直在尝试确定在哪个版本 由标签指定 中部署了特定修复 由提交指定 这里的一些帖子发布了这一点git tag contains是收集这些信息的方法 但是选项的文档 https git scm com docs git tag
  • gitattributes 中的`* text=auto eol=lf` 会做什么?

    我们的 gitattributes 文件中有这样的内容 text auto eol lf 我想准确理解这是做什么的 第一部分是text auto 来自文档 http git scm com docs gitattributes 这确保了所有
  • 如何摆脱 gerrit 中的错误依赖关系

    看起来 当使用 gerrit 时 默认情况下所有更改都依赖于前一个更改 我不会分支进行新的更改 我只是在主分支上工作 然后将提交的更改推送到远程源 主分支 即使两次提交彼此无关 每次都会创建依赖关系 我遇到了一些问题 这让我认为我没有正确地
  • 如何解决git中文件重命名文件夹冲突?

    我有以下问题 我有两个分支 Branch1 和 Branch2 的一些共同提交 A Branch1 是一个公共分支 位于服务器上 Branch2 是本地分支 在 Branch1 中我更改了文件 BAD folder somefile txt
  • git checkout HEAD -- 和有什么区别?和 git reset --hard HEAD?

    我已经查看了这个 stackoverflow 链接 但我认为我所要求的之间的细微差别是使用HEAD在结账命令中 因为他们的建议似乎不起作用 git reset hard HEAD 和 git checkout 之间有区别吗 https st
  • Git-svn:批量删除孤立的远程分支

    我正在处理的 SVN 项目 通过 git svn 有经常创建的分支 然后与主干重新集成 然后删除 现在项目大约有10个分支没有被删除 但是在git中 gitbranch r显示大约有50个 我可以一次删除这些 检查它们是否仍然存在于 svn
  • 无法快速删除 Git 中的许多文件

    我删除了 Git 分支中的 777 个文件新功能 by rm example 我愿意承诺 Git 要求我手动删除每个已删除的文件 git rm file 对于所有名称不相似的 777 个文件 编写上述命令将花费大量时间 如何删除我的 Git
  • 原始文件被分成另外两个文件,git 有没有办法查看内容去了哪里?

    我的问题 我是一名代码审查员 我在GIT中有一个情况 before a txt 然后开发人员决定拆分内容a txt分成 2 个文件 并在一次提交中添加一些更改 after b txt 很少的变化和c txt 一些变化 有没有简单的方法可以看
  • 无法在 git 上获取 Http 工作

    我在拇指驱动器上使用 gitbash 作为 git 我的防火墙阻止了我 并且想设置我的 git 以进行 http 访问 我使用 github 并且已经看到了有关如何执行此操作的各种信息 但我还不够了解 无法让它为我自己工作 我在 php i
  • 我应该如何将更改从一个提交转移到另一个提交?

    我在同一个分支上有两个提交 一个接一个 我在第一次提交中添加了对文件 A 的更改 然后对其他文件进行了一些更改 然后进行了另一次提交 现在我希望对文件 A 的更改是在第二次提交而不是第一次提交 最优雅的方式是什么 我知道这是一个老问题 但我
  • Git 用户配置文件 - 自定义忽略

    我们有一个由 5 名开发人员组成的团队致力于硬件项目 我们有一个 user config h 文件 其中包含每个用户的特定环境和偏好的 defines 例如他们使用的硬件版本 是否应该打开声音等 目前 该文件位于我们的 gitignore

随机推荐

  • centos mysql jar 驱动包_JDBC连接Mysql数据库详解

    JDBC Java DataBase Connectivity 即Java数据库连接 简而言之 就是通过Java语言来操作数据库 我们可以把JDBC理解成是官方定义的一套操作所有关系型数据库的规则 规则即接口 也就是说 官方定义了一套操作所
  • java实现单点登陆(SSO)

    java实现单点登陆 SSO 网络域名必须完全一致 才代表同一站点 域名映射 访问后面的 会跳转到前面 单点登陆概念 多系统 单一位置登录 实现多系统同时登陆 常出现在互联网和企业级平台中 单点登陆一般是用于互相授信的系统 实现单一位置登录
  • Unity Shader简介

    Shader 中文名为着色器 对很多开发者来说它是一个神秘的存在 想学但是又不知道如何去学 或者学了一段时间发现Get不到它的点 始终感觉游离在外 无法开窍 本文来讲下如何从零基础入门Shader 目的在于让初学Shader的程序或者美术可
  • C++ MyHttpServer网络服务器实验

    C MyHttpServer网络服务器实验 一 实验要求 二 文件夹管理 三 实验结果 四 程序代码 C 课程老师把这一个实验分成了五个小实验 VS版本是2019的 涉及Http协议的请求处理 响应处理 多线程等 有一两个实验老师的示例代码
  • 原理图改动后更新PCB报错的解决方法

    今天我在用Altium Designer 20绘制PCB时遇到了一个情况 在更改了原理图以后再进行Update PCB Document的时候软件会提示错误 截图如下 遇到这种情况时大家往往束手无策而选择重新建立一个空白的PCB板再去生成一
  • Spring MVC传递List类型参数报错:No primary or default constructor found for interface java.util.List]使用两种注解解决

    在测试GenericConverter传递List数组的时候 出现No primary or default constructor found for interface java util List with r这个错误 解决 因为报错
  • 单图像超分辨率重建总结

    单图像超分辨率重建总结 定义 单图像超分辨率重建 Single Image Super resolution Reconstruction SISR 旨在从给定的低分辨率 LR 图像中 重建含有清晰细节特征的高分辨率 HR 图像 是计算机视
  • vue和elementui实现多表格选择和查看已选的功能

    目录 功能描述 数据 HTML js CSS 功能描述 经常碰到需要写多个表格选择 并且可以查看已选项目的功能 实现功能大致如此 左侧是可选择的表 点击表展示每个表里可选字段 然后点击查看已选 可以展示以及选择的表格数据 如下图 涉及敏感字
  • BeanUtils应用,tojavabean

    package com bochy tojavabean import java util HashMap import java util Map import org apache commons beanutils locale co
  • 高清壁纸wallhaven.cc下载图片

    建议不要用多线程 设置延迟 不然会被封IP import requests import os import re import time from concurrent futures import ThreadPoolExecutor
  • GCN代码详解(SEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKS(2017ICLR))

    不足之处请大家多多指点 文章目录 链接 代码详解 链接 论文题目 用图卷积网络进行自监督分类 GCN 2017ICLR 论文链接 1609 02907v3 pdf arxiv org 代码链接 tkipf pygcn Graph Convo
  • 总链接地址

    链接 达内博客 链接地址 程序媛泡泡 https blog csdn net weixin 43884234 cgblpx 皮皮虾 https blog csdn net u012932876 闪耀太阳 https blog csdn ne
  • python环境离线打包环境、离线环境迁移、离线环境复制、离线环境克隆

    我们经常使用conda来管理自己环境 时间久了 环境中的依赖错综复杂 有的通过pip或者conda下载 有的是离线安装 有的是通过魔法下载 这时候如果要将本机环境复制到另一台计算机中就会非常麻烦 甚至另一台计算机无法联网 这时候可以使用co
  • uni-app简单介绍

    uni app简单介绍 https uniapp dcloud io 一 什么是uni app uni app 是一个使用 Vue js 开发所有前端应用的框架 开发者编写一套代码 可发布到iOS Android Web 响应式 以及各种小
  • 转:Vue项目中的token验证登录(前端部分)

    声明 此文章是转载 2 问题 做一个登录界面 我选择的是用token进行验证登录 我用的前端框架是Vue js 和 element ui 如何在vue 中使用token进行验证登录 3 思考 1 利用token进行验证登录 用户进行登录操作
  • TF卡目录显示文件夹变0字节的方法

    关于电脑上的目录打不开是什么原因 电脑目录打不开是什么原因这个许多人还不清楚 今天小编来为大家解答目录打不开状况 此刻让好多人一起来瞧瞧吧 TF卡目录显示文件夹变0字节的方法 工具 软件 sayRecy 步骤1 先百度搜索并下载程序打开后
  • Python:赋值,copy和deepcopy区别

    参考 Python赋值 copy deepcopy区别 结论 copy 与deepcopy 之间的主要区别是python对数据的存储方式 python2中 需要import copy模块 python3中 直接可以使用copy 方法 但de
  • Postman —— postman实现参数化

    什么时候会用到参数化 比如 一个模块要用多组不同数据进行测试 验证业务的正确性 Login模块 正确的用户名 密码 成功 错误的用户名 正确的密码 失败 postman实现参数化 在实际的接口测试中 部分参数每次发送请求时都要唯一 比如注册
  • jacoco检测功能或自动化测试覆盖率

    参考文档 http t csdn cn QqCSh http t csdn cn HonVL 目录 下载jacoco 启动jacocoagent监控被测项目 执行手工测试 生成exec文件 生成report报告 jacoco代码覆盖率报告分
  • 【Hexo博客搭建】将其部署到GitHub Pages(二):如何初始化并部署?

    系列目录 Hexo博客搭建 将其部署到 GitHub Pages 一 前期要做哪些准备 Hexo博客搭建 将其部署到 GitHub Pages 二 如何初始化并部署 Hexo博客搭建 将其部署到 GitHub Pages 三 怎么写作以及更