[英]git - commit single repository in empty directory without having downloaded repo
Is it possible to not have to download the entire repo before making a commit, ie, to commit just a single local file or local folder by itself (without already having the existing stuff in the repo in the local directory)? 是否有可能没有作出承诺,即通过自身承诺只是一个单一的本地文件或本地文件夹(没有在本地目录中已经有在回购现有的东西)之前下载整个回购?
Specifically: 特别:
I have in a local directory, only the following to commit (with all files inside the directory): 我在本地目录中, 只有以下内容要提交(目录中包含所有文件):
\\Local\\SingleFolder
The local directory only contains that single folder. 本地目录仅包含该单个文件夹。
The remote directory, contains lots of stuff
: 远程目录,包含
lots of stuff
:
Folder1 Folder2 file1.cpp anotherfile.cpp ... (etc)
I don't want to download all that stuff locally. 我不想在本地下载所有这些东西。
Can I commit just my single \\Local\\SingleFolder
without having to download lots of stuff
? 我可以只提交一个
\\Local\\SingleFolder
而不必下载lots of stuff
吗?
-- -
Reason: computer with these files is on low disk space (blame apple tiny Flash drives), and I only need to commit one folder to an existing large repo. 原因:具有这些文件的计算机磁盘空间不足(怪异的苹果微型闪存驱动器),我只需要将一个文件夹提交到现有的大型存储库即可。 I'm trying to avoid having to USB this...
我正在尝试避免必须使用USB ...
There is no way I see you can do it unless you have the repository locally somewhere (on some other machine also). 除非您将存储库放在本地某个地方(也位于其他机器上),否则我看不出您可以这样做。
What you can do: 你可以做什么:
1. Create a new folder and make it a git repo ( git init
) 1.创建一个新文件夹并使其成为git repo(
git init
)
2. Add \\Local\\SingleFolder
and commit it. 2.添加
\\Local\\SingleFolder
并提交。
3. Create a patch of that commit ( git format-patch -1
) 4. Mail the patch to someone who has the repository downloaded(cloned) 3.创建该提交的补丁(
git format-patch -1
)4.将补丁邮寄给已下载(克隆)存储库的人
5. Ask them to do git am --ignore-whitespace <patch-file>
to whichever branch you require 5.要求他们对所需的任何分支执行
git am --ignore-whitespace <patch-file>
6. Push it! 6.推!
Et voila! 瞧!
Hope this helps! 希望这可以帮助! :)
:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.