美文网首页
GItHub上传代码

GItHub上传代码

作者: Zzzzzed丶Van | 来源:发表于2018-03-11 18:09 被阅读84次

1.首先需要下载Git并安装,下载地址: Git地址

2.打开终端 使用git --version 命令查看安装版本,出现 git version 2.16.2 证明安装成功

3.查看.ssh 在终端中输入 cd ~/.ssh 查看.ssh是否存在

4.如果提示 No such file or directory说明.ssh文件夹不存在 接着在终端中输入 ssh-keygen -t rsa -C xxx@xxx.com 其中xxx@xxx.com为你注册GitHub时的邮箱账号 回车之后出现如下图所示

/Users/xxxxx/.ssh/id_rsa 为默认的存储地址  直接回车 会提示你输入密码,为ssh设置密码之后回车

5.在GitHub上创建SSH 如下图点击头像选择settings

settings SSH and GPG keys

选择SSH and GPG keys

new SSH key

点击 New SSH key 添加新SSH

title

Title: xxx@xxx.com (建议填你的邮箱)

Key: 通过默认路径(/User/yourname/.ssh/id_rsa.pub)文本编辑器打开你生成的id_rsa.pub文件复制其中内容(id_rsa.pub默认隐藏 可以通过command+shift+.显示隐藏文件)    也可以直接在终端输入cat ~/.ssh/id_rsa.pub查看文件内容

6.在GitHub上创建版本库(Repository),

新建版本库

默认README不勾选 创建完成后跳转到

7.上传代码

cd到代码文件夹依次输入一下命令

touch README.md

git init   

git add README.md 

git commit -m "你的注释...." 

git remote add origin https://github.com/yourName/Test.git

git push -u origin master 

初始化完成之后 我们可以把项目的源代码提交上去 依次执行以下命令

 git add .    (添加整个代码到本地代码库)

git commit -m "上传代码" 

git push origin master 

最后刷新 GitHub 显示我们刚刚提交的项目源代码

swift动态码 类似将军令

相关文章

  • Leetcode 88. Merge Sorted Array

    Python 3 实现: 源代码已上传 Github,持续更新。 源代码已上传至 Github,持续更新中。

  • Leetcode 21. Merge Two Sorted Li

    Python 3 实现: 源代码已上传 Github,持续更新。 源代码已上传至 Github,持续更新中。

  • Leetcode 9. Palindrome Number

    Python 3 实现: 源代码已上传 Github,持续更新。 源代码已上传至 Github,持续更新中。

  • Leetcode 4. Median of Two Sorted

    Python 3 实现: 源代码已上传 Github,持续更新。 源代码已上传至 Github,持续更新中。

  • 上传github 代码

    一、注册github账号 首先需要注册一个github账号,注册地址:https://github.com 接着会...

  • 代码上传github

    1.先在github上新建一个远程仓库,仓库名字一般写框架名字 2.将远程仓库上的代码(里面只有一些初始化的东西)...

  • 代码上传github

    1.首先注册github账号,登录,创建新仓库,点击+,点击new repository 2.填写仓库名,自己随便...

  • Github代码上传

    # Github代码上传 # ## 打开Github,注册账号,创建新的项目 ## https://github....

  • Leetcode 64: Minimum Path Sum

    动态规划 Python 3 实现: 源代码已上传 Github,持续更新。 源代码已上传至 Github,持续更新中。

  • Leetcode 7. Reverse Integer

    整型反转,Python 3 实现: 源代码已上传 Github,持续更新。 源代码已上传至 Github,持续更新中。

网友评论

      本文标题:GItHub上传代码

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