Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何将本地项目推送到远程存储库下_Git_Github_Directory_Project - Fatal编程技术网

Git 如何将本地项目推送到远程存储库下

Git 如何将本地项目推送到远程存储库下,git,github,directory,project,Git,Github,Directory,Project,我是github的新手。我有两个github存储库,分别名为“ios”和“android”。我有多个ios和android项目,例如:ios-1、ios-2、android-1、android-2。 如何将ios-1和ios-2从本地推送到远程ios回购下?而android-1和android-2则属于回购安卓系统。 基本上,我希望我的github是这样组织的: ios ios-1 ios-2 android android-1 android-2 使用git

我是github的新手。我有两个github存储库,分别名为“ios”和“android”。我有多个ios和android项目,例如:ios-1、ios-2、android-1、android-2。 如何将ios-1和ios-2从本地推送到远程ios回购下?而android-1和android-2则属于回购安卓系统。 基本上,我希望我的github是这样组织的:

ios
    ios-1
    ios-2

android
    android-1
    android-2

使用
git克隆将各个存储库克隆到计算机上所需的位置https://github.com/终端中的(用户名)/(存储库名称).git
命令。一旦要推送到Github的文件位于其各自的存储库中(即由上一个命令生成的文件夹),使用
git add.
命令将文件添加到git索引,然后使用
git commit-m“your message here”
提交这些新添加的内容。最后,您可以使用命令
git checkout-b(分支名称)
将您的提交推送到所需的分支,并使用命令
git push origin(分支名称)
将您的更改推送到分支的源。除非您在存储库中创建了其他分支,否则分支名称将为master

我上面的回答不是非常深入,也没有提供您可能需要的所有git命令。它只提供了使用Github的基础知识,这种方式非常适合于简单的单人项目。下面链接的是一些精彩的资源,它们提供了更多的细节以及Github的其他命令和用法,这些都超出了我在上面简要介绍的基础知识。