美文网首页编程语言爱好者程序园
将本地工程推送到github

将本地工程推送到github

作者: 赵阳_c149 | 来源:发表于2019-08-01 17:26 被阅读2次
    1. github上新建repo
      登录github,点击右上角账户图标(菜单),点击Repositories。新建repo,点击“clone or download”,得到repo的url:https://github.com/${user}/xxxx.git。
    2. 配置客户端与git服务器ssh免交互认证
      点击右上角账户图标(菜单),点击“settings”,点击”SSH and GPG keys“。在本地机器上生成ssh keys,将你的SSH key 加入github的ssh-agent【1】。
    3. 在本地建立目录并初始化
    mkdir your_project
    cd your_project
    git init
    
    1. 添加远程repo【2】
    git remote add origin https://github.com/${user}/xxxx.git
    
    1. 提交文件
    touch README.md
    git add README.md
    git commit -m "first commit"
    git push -u origin master
    

    【1】generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
    【2】adding-a-remote

    相关文章

      网友评论

        本文标题:将本地工程推送到github

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