1 Star 3 Fork 0

江节胜 / GiteePages主页

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Git-在GitHub或码云上搭建预览项目或个人主页-Git同时提交到多个远程仓库

一、搭建Git个人主页:

Github上创建项目的名称为 jiangjiesheng.github.io settings > pages > 选择一下即可,根目录中必须有首页index.html

Gitee上创建 则直接用户名,即jiangjiesheng 服务 > pages 设置启动,根目录可以是index.html 或者 README.MD

(如果是预览某个项目的线上效果,只需要设置pages页就可以)

Gitee码云和GitHub对比:

  • 1、码云可以免费设置项目为私有项目,不被公开;GitHub若设置私有项目,则需要收费。 (码云中的项目设置为私有时,主页仍然可以访问)
  • 2、码云服务器在国内,响应速度快;Github在国外,访问速度实测非常慢,且不稳定。

二、提交代码到多个Git仓库

Git项目目录下有个隐藏的.git 文件夹,其中有个config文件,使用编辑器打开

    [remote] 节点表示远程仓库,默认有个origin仓库地址,
    新增一个[remote] ,并指定名称为"mirror",作为镜像仓库。

    ([branch ]为分页节点,这里可以忽略)

示例:

    [remote "origin"]
	    url = git@github.com:jiangjiesheng/jiangjiesheng.github.io.git
	    fetch = +refs/heads/*:refs/remotes/origin/*
    [remote "mirror"]
	    url = https://gitee.com/jiangjiesheng/jiangjiesheng.git
	    fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
	    remote = origin
	    merge = refs/heads/master

pull拉取操作

分别从两个远程仓库pull:

    git pull origin master 
    git pull mirror master

push提交操作

分别push到两个远程仓库:

    git push origin master 
    git push mirror master
    或者 
    git push mirror master && git push origin master

三、效果展示:

Git仓库地址:

Repository Comments ( 0 )

Sign in to post a comment

About

江节胜的GiteePages主页 expand collapse
CSS and 4 more languages
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
1
https://gitee.com/jiangjiesheng/jiangjiesheng.git
git@gitee.com:jiangjiesheng/jiangjiesheng.git
jiangjiesheng
jiangjiesheng
GiteePages主页
master

Search

101014 b92fc32e 1850385 101014 af024cb7 1850385