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