0
我正在开发一个iOS项目。我们的员工已经创建了一个存储库说应用程序,我们默认有一个主分支。员工已经创建了另一个分支说“第二”现在我需要从我的机器上传我的项目文件到Github存储库的分支“第二个”看着很多教程,并没有理解什么和怎么做......这个问题可能已经问过,但对不起没有帮助...将项目文件从本地计算机添加到Github存储库
我正在开发一个iOS项目。我们的员工已经创建了一个存储库说应用程序,我们默认有一个主分支。员工已经创建了另一个分支说“第二”现在我需要从我的机器上传我的项目文件到Github存储库的分支“第二个”看着很多教程,并没有理解什么和怎么做......这个问题可能已经问过,但对不起没有帮助...将项目文件从本地计算机添加到Github存储库
首先,做好你的项目的完整备份,所以 你可以恢复它,如果出现问题。
如果你有本地的Git仓库(在终端你可以看到git的git的和****文件执行后,在项目目录的“ls -la”命令):
1) Open your project folder with your local git repository in Terminal and add your Github repository as origin:
$ git remote add origin https://github.com/your_user/your_repo.git
(This url you can see at Github repo)
2) Push all your local branches onto repository:
$ git push --all origin
如果你不这样做有本地的Git仓库:
1) Create new folder, go inside it and in Terminal execute this:
$ git clone https://github.com/your_user/your_repo.git
2) Copy all your iOS project (with inner files/folders/etc) into that folder
3) Add all your local files into local git repo:
$ git add .
4) Commit all changes:
$ git commit -m initial
5) Push all your local branches onto repository:
$ git push --all origin
Also see Github help:
https://help.github.com/articles/adding-a-remote/
https://help.github.com/articles/pushing-to-a-remote/
'git的克隆 --branch --single分支[]'克隆一个特定的分支,然后修改并提交,你通常会做,会改变只在存在你克隆的分支。文档:http://www.git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging –
如果分支“second”是从您的主分支创建的,您能更好地描述它吗那么你只需要将“主”合并为“第二”即可。 – Krzysztof
@Krzysztof我真的不太了解这些操作。这是我第一次使用Github。但是当我问我的员工时,他说这是由主人 – Joker