单个git repo推送到多个遥控器

时间:2019-05-14 14:43:42

标签: git github

我有一个Pelican静态网站,我想推送到GitHub页面。我的设置方式是,将配置文件(src)保存在一个目录中,而实际上的HTML / CSS文章(页面)保存在另一个content/目录中。我想使用一个本地存储库为这些文件中的每个文件提供两个单独的远程存储库。这些是我的遥控器

$ git remote -v
pages   git@github.com:Timothy-Pulliam/Timothy-Pulliam.github.io.git (fetch)
pages   git@github.com:Timothy-Pulliam/Timothy-Pulliam.github.io.git (push)
src git@github.com:Timothy-Pulliam/linuxandchill-src.git (fetch)
src git@github.com:Timothy-Pulliam/linuxandchill-src.git (push)

但是,当我发表文章时,我的src/master现在会落后于HEAD/master。但是我不希望src包含最新的提交,因为我没有进行任何配置更改,只发布了一篇新文章(我的src repo设置为通过.git / info / exclude忽略输出/文章)

(venv) tpulliam@lappy:~/code/linuxandchill-src$ ghp-import -m "Generate Pelican site" -r git@github.com:Timothy-Pulliam/Timothy-Pulliam.github.io.git -b master content/
(venv) tpulliam@lappy:~/code/linuxandchill-src$ git push pages master
Counting objects: 9, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 7.05 KiB | 2.35 MiB/s, done.
Total 9 (delta 1), reused 5 (delta 0)
remote: Resolving deltas: 100% (1/1), done.
To github.com:Timothy-Pulliam/Timothy-Pulliam.github.io.git
   c33a107..50cf76f  master -> master

commit 50cf76f051ff7190e5e52a8596b8f684c47fb57f (HEAD -> master, pages/master)
Author: Timothy Pulliam <timothy.dpulliam@gmail.com>
Date:   Tue May 14 10:29:32 2019 -0400

    Generate Pelican site

commit c33a107e2624455c70a854ed834c783c301182a6 (src/master, src/HEAD)
Author: Timothy Pulliam <timothy.dpulliam@gmail.com>
Date:   Tue May 14 10:10:09 2019 -0400

    Generate Pelican site

我的问题

我在为自己想完成的事情采用正确的方法吗?我希望避免不必要的提交和问题。这是目录结构,可让您更好地了解正在使用的内容。

linuxandchill-src/
├── content
├── Makefile
├── output
├── pelicanconf.py
├── publishconf.py
├── README.md
├── requirements.txt
├── tasks.py
└── venv

0 个答案:

没有答案