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 文件中。

  • 相关阅读:
    替代传统C/S和B/S技术的下一代客户/服务器编程技术
    理想的编程语言
    nginx进程模型
    Sybase 7.0 中文乱码问题
    netfilter 链接跟踪机制与NAT原理
    TraTraffic Server 进程模型
    nginx并发模型与traffic_server并发模型简单比较
    vs/nat原理分析
    ORACLE 查询表信息
    in 跟exists的区别
  • 原文地址:https://www.cnblogs.com/litifeng/p/5597564.html
Copyright © 2011-2022 走看看