zoukankan      html  css  js  c++  java
  • GitHub配置步骤和简单的git关联

    通过git书籍学习

    1. 创建账户(username:Flora)

    2. 设置头像(不是必须)

    3. 设置SSH Key

      $ssh-keygen -t rsa -C "email@email.com" //创建用户时使用的邮箱 -> 回车 -> 密码 -> 密码

      生成id_rsa私有密钥,id_rsa.pub公开密钥

    4. 添加公开密钥

      右上角 -> Account Settings -> SSH Key -> Add SSH Key -> title适当,key是id_rsa.pub里面的内容(用cat ~/.ssh/id_rsa.pub -> ssh-rsa 公开密钥内容 email@email.com)

      ->测试 ssh -T email@email.com, 输入yes

    5. 使用

      右上角 -> New repository创建一个新库(repository name: hello-world) -> 注意: "Initialize this respository with a readme", 自动初始化库并设置Readme文件,让用户可以立即clone这个仓库。如果向GitHub添加手中已有的git仓库,不建议勾选,直接手动push -> 链接才仓库(https://github.com/Flora用户名/hello-world库名)-> readme.md文件显示项目等信息,可以用MarkDown语法进行描述,添加标记,提高可读性。

    6. 将已有的仓库clone到身边的开发环境中。找到SSH clone URL,将内容复制, git clone 复制的内容

      SSH clone URL: git@github.com:Flora/hello-world.git 输入创建key时的密码

      git clone git@github.com:Flora/hello-world.git

      cd hello-world

      添加一个文件hello_world.php

      git add hello_world.php 将文件放到暂存区(在Index数据结构中记录问价提交之前的状态)

      git commit -m 'Add hello_world file' 提交

      git log 查看提交日志

      git push 如果建立了分支(git branch develop)使用git push origin master

      

  • 相关阅读:
    JavaScript根据CSS的Media Queries来判断浏览设备的方法
    JavaScript API 设计原则
    高性能 CSS3 动画
    CSS代码实例:用CSS代码写出的各种形状图形
    frontpage 2010.2003绿色版
    Web前端年后跳槽必看的各种面试题
    [ksm][数学] Jzoj P5810 简单的玄学
    [分治] Jzoj P5807 简单的区间
    [dfs][bfs] Jzoj P5806 简单的操作
    [dp] Jzoj P5804 简单的序列
  • 原文地址:https://www.cnblogs.com/floraCnblogs/p/github-and-git.html
Copyright © 2011-2022 走看看