将 Xcode 项目添加到 github 仓库? [英] Add Xcode project to github repo?
问题描述
我刚刚在网站上创建了一个新的 github 存储库.请记住,我是一个菜鸟,但可以在终端中做基本的事情.无论如何,所以我只是在我在 github.com 上的帐户上创建了 repo,但还没有做任何事情.
I have JUST created a new github repo on the website. Keep in mind that I am a noob but can do basic things in terminal. Anyway, so I just created the repo on my account on github.com and didn't do a single thing to it yet.
所以我想要做的就是将我的 Xcode 项目文件夹上传到我的新 github 存储库.我如何通过终端执行此操作?
So all I want to do is take my Xcode project folder and upload it to my new github repo. How do I do this via terminal?
推荐答案
最好的方法确实是按照 GitHub 给您的说明进行操作:
The best way really is to follow the instructions GitHub gives you:
首先进入正确的目录
cd <directory of your Xcode project>
听起来您已经从 Xcode 获得了一个本地 Git 项目.如果是这样,请跳过此代码块.
It sound like you've already got a local Git project from Xcode. If that's true, skip this code block.
git init .
git add .
git commit -s
<type in a commit message>
最后,推送到您的存储库中.在我创建了一个新的测试"repo 之后,以下内容是直接从我自己的 github 帐户中复制的.更改dhalperi/test"部分.
Last, push into your repository. The following is copied directly from my own github account, after I created a new "test" repo. Change the "dhalperi/test" part.
从命令行推送现有存储库
git remote add origin git@github.com:dhalperi/test.git
git push -u origin master
这篇关于将 Xcode 项目添加到 github 仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!