zoukankan      html  css  js  c++  java
  • git从ssh到提交到github


    1、安装 Git 客户端 yum install git 

    2、打开 Git Bash,开始键入用户信息,和github通讯用的,不能乱写:

    git config --global user.name "You Name"
    git config --global user.email yourmail@server.com
    git config --global color.ui true   //这一条主要是为不同状态添加不同颜色。


    第二步:注册 GitHub,配置相关信息

    1、成功注册 GitHub 帐号后,创建 GitHub SSH密匙,Git Bash 下键入命令:

    ssh-keygen -C 'yourmail@server.com' -t rsa
    2、回到 GitHub 个人首页,点击 Account Settings -> SSH Public Keys -> Add another public key。title 可以随便取名字,Key 里面添加的内容为 id_rsa.pub 文件内所有的代码。然后点击 Apply 即可。

    测试与 GitHub 是否连接成功:ssh git@github.com

    如果输出下面内容,表示连接成功了。

    PTY allocation request failed on channel 0
    Hi USER_NAME! You've successfully authenticated, but GitHub does not provide shell access.
    Connection to github.com closed.


    3、可以在 GitHub 上添加第一个空的 Git 仓库 ,假设为test
    4、用git clone将刚刚建立的仓库,克隆到本地。

    git@github.com:xxx/test.git

    5、将需要的文件拷贝到本地仓库内。

    6、运行一下git  status查看一下,你会发现许多刚刚加入的文件。

    7、运行 git add . 将需要的文件全部添加到git库中。

    8、提交。 git commit -m 'first commit' 

    9、推送到github。 git push

    10、备注,git会在每个仓库中添加一个 .git 隐藏文件夹来保存git的信息和配置文件,仔细阅读会有很多收获。git的全局配置文件,在用户目录下的 .gitconfig 文件中。

  • 相关阅读:
    font-weight:bolder与设置数值的区别
    纯CSS3打造圆形菜单
    CSS Specificity
    控制页面内跳转
    解决Python操作MySQL中文乱码的问题
    字体图标font-awesome
    linux下安装使用MySQL 以及 python mysqldb 遇到的问题
    CocosCreator游戏开发(二)SocketIO简易教程
    CocosCreator游戏开发---菜鸟学习之路(一)资料整理
    2017已经接近尾声,然而我却什么都没干成
  • 原文地址:https://www.cnblogs.com/litifeng/p/5597564.html
Copyright © 2011-2022 走看看