gpt4 book ai didi

xcode - 将 Xcode 项目添加到 github 存储库?

转载 作者:IT王子 更新时间:2023-10-29 00:43:22 25 4
gpt4 key购买 nike

我刚刚在网站上创建了一个新的 github 存储库。请记住,我是一个菜鸟,但可以在终端中做一些基本的事情。不管怎样,我只是在 github.com 上的我的帐户上创建了 repo,还没有对它做任何事情。

所以我想做的就是将我的 Xcode 项目文件夹上传到我的新 github 存储库。我如何通过终端执行此操作?

最佳答案

真正最好的方法是按照 GitHub 给您的说明进行操作:

首先,进入正确的目录

cd <directory of your Xcode project>

听起来您已经从 Xcode 获得了一个本地 Git 项目。如果是这样,请跳过此代码块。

git init .
git add .
git commit -s
<type in a commit message>

最后,推送到您的存储库。在我创建一个新的“测试” repo 协议(protocol)后,以下是直接从我自己的 github 帐户复制的。更改“dhalperi/test”部分。

Push an existing repository from the command line

git remote add origin git@github.com:dhalperi/test.git
git push -u origin master

关于xcode - 将 Xcode 项目添加到 github 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12698482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com