美文网首页
GitHub-Xcode内置Git提交

GitHub-Xcode内置Git提交

作者: 呆呆笨 | 来源:发表于2020-07-03 11:59 被阅读0次

Xcode 提交工程至GitHub有很多方法,这里只描述Xcode自带的Git的使用

第一步

在创建工程时,Source Control 一定要勾选


第二步

在Xcode -> Preferences -> Accounts 新增GitHub账号


其中账号对应的token生成看这里:GitHub Personal Access Token

第三步

本地生成SSH Key,见SSH Key生成
将id_rsa.pub中的公钥复制到GitHub -> Settings -> SSH and GPG keys -> New SSH key

github设置ssh

第四步

回到Xcode -> Preferences -> Accounts,选择GitHub,Clone Using 选择SSH,SSH Key 选择你使用在GitHub的SSH中的公钥,见第二步选择的.pub文件



如果有问题SSH Key下会显示,反之则成功。

第五步

选择版本控制导航器,右键项目选择Create "XXX" remote


注意:这里填写的Repository Name是在GitHub中不存的项目名称,否则会报错,所以不需要提前在GitHub中创建新的repository

{"message":"Repository creation failed.","errors":[{"resource":"Repository","code":"custom","field":"name","message":"name already exists on this account"}],"documentation_url":"https://developer.github.com/v3/repos/#create"}

如果创建成功不会有任何提示,如果创建失败可能会提示"Reference 'refs/heads/master' not found (-9)"或者"remote: Repository not found.",不要慌,这时候去GitHub上查看是否有生成对应的repository,如果没有,就重新提交一次;如果已经有了,则找工具栏Source Control -> Push,直接push就可以了。


是否成功,在GitHub上自己看看就知道啦,目前本人操作的完整流程就这些,没有遇到啥问题,如果有大家可以讨论讨论。

第六步

平时在修改完代码要提交时,找工具栏Source Control -> Commit,即可


以上为个人GitHub提交,还未尝试过该方法在合作开发中是否可行。

补充:左侧导航栏文件后的符号详解

相关文章

  • GitHub-Xcode内置Git提交

    Xcode 提交工程至GitHub有很多方法,这里只描述Xcode自带的Git的使用 第一步 在创建工程时,Sou...

  • git 入门

    1、git的安装 安装:不需要安装,Git Bash 内置了 Git 命令,Git Bash 还内置了以下命令:...

  • Git 的安装与配置

    安装不需要安装,Git Bash 内置了 Git 命令,Git Bash 还内置了以下命令: lsmkdircpm...

  • GIT命令

    新建路径: git clone 提交修改: git add . 本地提交: git comm...

  • 关于Git

    首次提交5条 git init .......git 重复提交3条 git add . git commit -m...

  • git常用命令

    git add . git commit -m "message"提交,其中message是提交的信息。 git ...

  • git 常用的命令

    git status 检测状态 git add . 提交的代码显示 git commit -m "备注" 提交...

  • 05_git版本回退和版本比较

    git log git的历史提交记录 commit 后面的hash值是 git提交id git log --pre...

  • idea terminal 改成 linux 操作

    用git的内置

  • 《git权威指南笔记》

    修改提交说明 git commit --amend修改最新提交的提交说明 git rebase -i

网友评论

      本文标题:GitHub-Xcode内置Git提交

      本文链接:https://www.haomeiwen.com/subject/wkdrqktx.html