协助高级 Git 克隆
Assistance with advanced Git Cloning
我是 GIT 的新手,希望得到一些帮助。
我了解克隆过程的基础知识,但是我有一个 GIT 存储库,我想使用 bash 脚本克隆并保持更新,但是我不确定如何完成此操作.
这里是问题所在:如果我使用以下命令 "git clone https://github.com/trakt/Plex-Trakt-Scrobbler" 我得到什么是根文件夹 - 我真正需要的是里面的分支 (trakttv.bundle) 作为根文件夹git 然后我可以简单地编写一个 cron 作业来执行 git 拉取更新。
有人可以告诉我可以直接克隆 trakttv.bundle 以允许我直接更新吗?希望这是有道理的 - 如果您想了解更多信息,请告诉我。
更新:经过进一步调查,我发现 Traktv.bundle 不是 repo 的一个分支——它是 master 分支下的一个文件夹结构。我查看了很多网站、示例和文档,但似乎无法仅克隆子文件夹
干杯,
达伦
git clone --branch trakttv.bundle https://github.com/trakt/Plex-Trakt-Scrobbler
您可以指定将在克隆后检出的分支。
本质上是这样
git clone https://github.com/trakt/Plex-Trakt-Scrobbler
git checkout trakttv.bundle
what I actually need is the branch inside (Trakttv.bundle
) to be the root of the git and then I can simply script a cron job to do a git pull
to update.
最好分开:
- git 布局
Plex-Trakt-Scrobbler/Trakttv.bundle/Contents
,您可以在其中执行 git pull
- 部署布局(您希望文件夹直接引用
Trakttv.bundle
,而不是 Plex-Trakt-Scrobbler/Trakttv.bundle
)
对于第二种情况,使用符号链接获取指向 Plex-Trakt-Scrobbler/Trakttv.bundle
的文件夹
cd /my/path
ln -s /path/to/Plex-Trakt-Scrobbler/Trakttv.bundle
ls
# output:
Trakttv.bundle
在 /my/path 中,您会直接看到 Trakttv.bundle
,但您会在 /path/to/Plex-Trakt-Scrobbler/Trakttv.bundle
中(使用 cron 作业)执行 git pull
。
我是 GIT 的新手,希望得到一些帮助。
我了解克隆过程的基础知识,但是我有一个 GIT 存储库,我想使用 bash 脚本克隆并保持更新,但是我不确定如何完成此操作.
这里是问题所在:如果我使用以下命令 "git clone https://github.com/trakt/Plex-Trakt-Scrobbler" 我得到什么是根文件夹 - 我真正需要的是里面的分支 (trakttv.bundle) 作为根文件夹git 然后我可以简单地编写一个 cron 作业来执行 git 拉取更新。
有人可以告诉我可以直接克隆 trakttv.bundle 以允许我直接更新吗?希望这是有道理的 - 如果您想了解更多信息,请告诉我。
更新:经过进一步调查,我发现 Traktv.bundle 不是 repo 的一个分支——它是 master 分支下的一个文件夹结构。我查看了很多网站、示例和文档,但似乎无法仅克隆子文件夹
干杯, 达伦
git clone --branch trakttv.bundle https://github.com/trakt/Plex-Trakt-Scrobbler
您可以指定将在克隆后检出的分支。
本质上是这样
git clone https://github.com/trakt/Plex-Trakt-Scrobbler
git checkout trakttv.bundle
what I actually need is the
branchinside (Trakttv.bundle
) to be the root of the git and then I can simply script a cron job to do agit pull
to update.
最好分开:
- git 布局
Plex-Trakt-Scrobbler/Trakttv.bundle/Contents
,您可以在其中执行git pull
- 部署布局(您希望文件夹直接引用
Trakttv.bundle
,而不是Plex-Trakt-Scrobbler/Trakttv.bundle
)
对于第二种情况,使用符号链接获取指向 Plex-Trakt-Scrobbler/Trakttv.bundle
cd /my/path
ln -s /path/to/Plex-Trakt-Scrobbler/Trakttv.bundle
ls
# output:
Trakttv.bundle
在 /my/path 中,您会直接看到 Trakttv.bundle
,但您会在 /path/to/Plex-Trakt-Scrobbler/Trakttv.bundle
中(使用 cron 作业)执行 git pull
。