我想在其他类似的任务中为League of Moveable Type的Chunk字体创建一个凉亭包/样式表.
我想知道是否可以将他们的"webfonts"目录分成新的repo中的"fonts"目录.这将允许我创建一个bower.json文件和样式表.
谢谢,
mu *_*u 無 15
我不认为你可以直接在github上的web UI上分叉,但如果你可以克隆它并手动推送东西,你可以做以下事情
克隆回购
git clone https://github.com/theleagueof/chunk
Run Code Online (Sandbox Code Playgroud)仅使用git subtree命令为该文件夹创建分支
git subtree split --prefix=folder_name -b new_branch
Run Code Online (Sandbox Code Playgroud)将此新仓库添加为远程,
git remote add upstream https://github.com/user/repo
Run Code Online (Sandbox Code Playgroud)推子树
git push upstream new_branch
Run Code Online (Sandbox Code Playgroud)Github 在https://help.github.com/en/articles/splitting-a-subfolder-out-into-a-new-repository发布了一篇文章如何做到这一点:
您可以将 Git 存储库中的文件夹转换为全新的存储库。
如果您创建存储库的新克隆,当您将文件夹拆分为单独的存储库时,您不会丢失任何 Git 历史记录或更改。
打开终端。
将当前工作目录更改为要创建新存储库的位置。
克隆包含子文件夹的存储库。
Run Code Online (Sandbox Code Playgroud)$ git clone https://github.com/USERNAME/REPOSITORY-NAME
- 将当前工作目录更改为您克隆的存储库。
Run Code Online (Sandbox Code Playgroud)$ cd REPOSITORY-NAME
要从存储库中的其余文件中过滤掉子文件夹,请运行 git filter-branch,提供以下信息:
FOLDER-NAME:项目中要从中创建单独存储库的文件夹。
BRANCH-NAME:当前项目的默认分支,例如 master 或 gh-pages。
Run Code Online (Sandbox Code Playgroud)$ git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME BRANCH-NAME # Filter the specified branch in your directory and remove empty commits > Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (89/89) > Ref 'refs/heads/BRANCH-NAME' was rewritten
存储库现在应该只包含子文件夹中的文件。
在 GitHub 上创建一个新存储库。
在新 GitHub 存储库的快速设置页面顶部,单击剪贴板以复制远程存储库 URL。
- 复制远程仓库 URL 字段
检查存储库的现有远程名称。例如,origin 或 upstream 是两个常见的选择。
Run Code Online (Sandbox Code Playgroud)$ git remote -v > origin https://github.com/USERNAME/REPOSITORY-NAME.git (fetch) > origin https://github.com/USERNAME/REPOSITORY-NAME.git (push)
- 使用现有的远程名称和您在步骤 7 中复制的远程存储库 URL 为新存储库设置新的远程 URL。
Run Code Online (Sandbox Code Playgroud)git remote set-url origin https://github.com/USERNAME/NEW-REPOSITORY-NAME.git
- 验证远程 URL 是否已更改为您的新存储库名称。
Run Code Online (Sandbox Code Playgroud)$ git remote -v # Verify new remote URL > origin https://github.com/USERNAME/NEW-REPOSITORY-NAME.git (fetch) > origin https://github.com/USERNAME/NEW-REPOSITORY-NAME.git (push)
- 将您的更改推送到 GitHub 上的新存储库。
Run Code Online (Sandbox Code Playgroud)git push -u origin BRANCH-NAME
归档时间: |
|
查看次数: |
4196 次 |
最近记录: |