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

时间:2019-02-04 19:00:26

标签: 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

我的代码现在在哪里?

1 个答案:

答案 0 :(得分:2)

当选择“源代码控制”>“创建Git存储库”时,您在Mac上创建了本地git存储库。该命令不会创建Bitbucket存储库,也不会将更改推送到Bitbucket。

使用Xcode的源代码控制导航器将您的项目放在Bitbucket上。通过选择“视图”>“导航器”>“显示源代码控制导航器”来打开“源代码控制”导航器。选择Remotes文件夹,按住Control键并单击,然后选择Create Remote在Bitbucket上创建一个远程存储库。

在存储库名称中避免使用大写字母。如果存储库名称中包含大写字母,则Xcode会打开一条警报,提示发生未知错误。这是Bitbucket存储库而不是GitHub存储库的问题。

选择“源代码控制”>按将所做的更改推送到Bitbucket。您可以在以下文章中找到更多详细信息:

Putting Your Xcode Project on GitHub, Bitbucket, or GitLab