Skip to content

Instantly share code, notes, and snippets.

@GeekaholicLin
Last active June 9, 2016 13:32
Show Gist options
  • Save GeekaholicLin/58c67d4d536c5fa9fe4b21b650b84609 to your computer and use it in GitHub Desktop.
Save GeekaholicLin/58c67d4d536c5fa9fe4b21b650b84609 to your computer and use it in GitHub Desktop.
如何备份博客至私人仓库

####过程并不复杂,也不需要工具####

A电脑

添加ssh key 到oschina,匹配成功并新建私人项目,拉取下来 /.git/config --可多配置git repo,push到多个地方 参考地址:http://memoryboxes.github.io/blog/2014/12/07/duo-ge-gitzhang-hao-zhi-jian-de-qie-huan/

[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
	hideDotFiles = dotGitOnly
[remote "origin"]
	url = git@git.oschina.net:geekaholic/MyHexoBlog.git
	fetch = +refs/heads/*:refs/remotes/oschina/*

/.gitignore -- 只屏蔽这两个文件夹

/.deploy_git
/public

使用git 的git push 命令push到repo

B电脑

拉取下来(此时已经包括插件) 运行hexo命令hexo clean && hexo g,进行生成文章 运行hexo d发布到github 的 pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment