zoukankan      html  css  js  c++  java
  • Github远程仓库关联

    一、Git的安装

    1、git的安装和配置

    (1)配置用户名和邮箱,如下所示:

    $ git config --global user.name [username]
    $ git config --global user.email [email]

    (2)使用git config --list查看已设配置的信息:

    core.symlinks=false
    core.autocrlf=true
    core.fscache=true
    color.diff=auto
    color.status=auto
    color.branch=auto
    color.interactive=true
    help.format=html
    http.sslcainfo=d:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
    diff.astextplain.textconv=astextplain
    rebase.autosquash=true
    credential.helper=manager
    user.name=用户名
    user.email=邮箱
    core.autocrlf=false
    core.repositoryformatversion=0
    core.filemode=false
    core.bare=false
    core.logallrefupdates=true
    core.symlinks=false
    core.ignorecase=true

    2、SSH Key的配置:

    1.Windows下打开Git Bash,创建SSH Key,按提示输入密码,可以不填密码一路回车

    $ ssh-keygen -t rsa -C "注册邮箱"

    然后用户主目录/.ssh/下有两个文件,id_rsa是私钥,id_rsa.pub是公钥。

    2.获取key,打开.ssh下的id_rsa.pub文件,里面的内容就是key的内容

    $ cat ~/.ssh/id_rsa.pub

    3.登录GitHub,打开"SSH Keys"页面,快捷地址:https://github.com/settings/keys

     

    4.测试ssh key是否成功,使用命令“ssh -T git@github.com”,如果出现You’ve successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。

    二、在GitHub上创建远程仓库

    1、点击上方导航栏的“+”按钮,在下方选择“New  repository”。

    2、进入到创建项目页面,按照下图所示输入你要创建项目的信息。

    3、获取创建的仓库地址:

    4、使用git clone [仓库地址],拉取代码到本地。

    $ git clone git@github.com:xxxx/java_ee.git

    5、接着可以进行git add、git commit、git push来进行操作。

  • 相关阅读:
    基于Ubuntu + nextCloud 搭建自己的私人网盘
    基于Ubuntu部署 memcached 服务
    基于Ubuntu搭建Seafile专属网盘
    基于ubuntu搭建 Discuz 论坛
    基于ubuntu搭建 WordPress 个人博客
    基于CentOS 搭建 FTP 文件服务
    搭建 WordPress 个人博客
    Scale-out NAS 和scale-up NAS 系统的优缺点
    鱼缸的启示:Scale-out和Scale-up架构
    整死你个妖精,CDN西游捉妖记!
  • 原文地址:https://www.cnblogs.com/yufeng218/p/6500885.html
Copyright © 2011-2022 走看看