How to upload your project to GitHub

来源:互联网 发布:阿里云cdn节点ip 编辑:程序博客网 时间:2024/05/17 23:56

git rm -r —cached .git add .

1. 在github上注册账号

2. 在github上new一个repository

选择add .gitignore

3. 在MAC电脑生成ssh秘钥

ssh-keygen -t rsa -C “email@email.com”
在随后出现的输入项中输入以下内容:

Enter file in which to save the key (/Users/用户名/...ssh/id_rsa): ???[若不填写,默认生成id_rsa文件]

Enter passphrase (empty for no passphrase): ?????/ [密码需大于4位]


之后将生成的id_rsa.pub文件内容复制到github->account setting->SSH Keys中

4. xcode本地git库建立

  • 一种是方法是在创建project的时候选择[Create Git repository on]。
  • 另一种方法如下,在项目目录下执行 git init

5. xcode pull remote库

点开项目将ssh的URL地址复制出来

选择[Check out an existing project]

pull remote库,再覆盖前面的本地project


6. 清除本地cache

git rm -r —cached .git add .
先commit,再push至github


0 0
原创粉丝点击