ios - Xcode > 源代码管理 > 创建 Git 存储库

标签 ios xcode git macos macos-mojave

我使用 Xcode 10 Mac OS X Mojave。我去了

源代码管理 > 创建 Git 存储库以创建我的初始提交



看来是成功了。但我不确定我的 Xcode 将我的代码推送到哪里?

在我的 Xcode 中,我去了源代码,我看到了这个



在我的 Bitbucket 帐户中,我没有看到任何推送或创建的内容。
Bitbucket 是我在 中链接的唯一帐户Xcode > 偏好 .

我跑了git config --list , 我有

⚡️  Alimofire  git config --list
credential.helper=osxkeychain
user.name=john doe
user.email=john@outlook.com
core.excludesfile=/Users/bheng/.gitignore_global
core.filemode=false
difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true
push.default=matching
commit.template=/Users/bheng/.stCommitMsg
core.bare=false
core.repositoryformatversion=0
core.filemode=true
core.ignorecase=true
core.precomposeunicode=true
core.logallrefupdates=true

我的代码现在在哪里?

最佳答案

当您选择 Source Control > Create Git Repositories 时,您在 Mac 上创建了一个本地 git 存储库。该命令不会创建 Bitbucket 存储库或将更改推送到 Bitbucket。

使用 Xcode 的源代码管理导航器将您的项目放在 Bitbucket 上。通过选择 View > Navigator > Show Source Control Navigator 打开 Source Control 导航器。选择 Remotes 文件夹,按住 Control 单击并选择 Create Remote 以在 Bitbucket 上创建远程存储库。

避免在存储库名称中包含大写字母。如果存储库名称中有大写字母,Xcode 会打开一个警告说 发生未知错误 .这是 Bitbucket 存储库的问题,而不是 GitHub 存储库的问题。

选择 Source Control > Push 将您的更改推送到 Bitbucket。您可以在以下文章中找到更详细的信息:

Putting Your Xcode Project on GitHub, Bitbucket, or GitLab

关于ios - Xcode > 源代码管理 > 创建 Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54522657/

相关文章:

ios - 将 Swift 中的 Azure B2C 与 native 登录屏幕集成

ios - RKObjectMapping 和 RKEntityMapping 的关系

swift - 多个 UITableViewCells 每个都有 UIProgressView 更新非常慢

git - 为什么在命令 `master` 中包含 `git fetch upstream master` ?

git - 是否可以在不丢失 merge 信息的情况下重写分支的历史记录?

ios - 如何正确配置 MMDrawerController

ios - 绕过 "Sign in with Apple"

xcode - 如何在 xcode 中删除过时的机器人

git - Azure DevOps 使用不同项目中另一个存储库的模块

objective-c - 如何将 UIPicker 与多个文本字段一起使用