zoukankan      html  css  js  c++  java
  • 第一次用Github desktop(mac)提交代码遇到的问题

    1.新建代码仓库

    2.生成密钥

    ssh-keygen -C 'your@email.address' -t rsa

    3.到根目录下的.ssh文件夹下找到id_rsa.pub文件,将里面的内容复制到下图所标的位置

    4.在Git shell下输入ssh -T git@github.com测试刚才上传的公钥是否正确

    正确时会显示:

    Hi "Your Name"! You've successfully authenticated, but GitHub does not provide shell access.

     

    5.赋值刚创建的代码仓库的地址,把仓库内容clone到本地

    git clone https://github.com/YangXudongJack/JYMenuview.git

     

    6.这样就把代码clone到了本地,然后找到仓库文件,把要提交的代码文件copy到里面

     

    7.切到Git shell下输入命令

    git init

    git commit -m 'JYMenuview'

    git remote add origin https://github.com/YangXudongJack/JYMenuview.git

    git push origin master

     

     

    (1)如果执行git commit -m 'JYMenuview'报错提示

    On branch master

    Your branch is up-to-date with 'origin/master'.

    Untracked files:

    JYMenuview.xcodeproj/

    JYMenuview/

    JYMenuviewTests/

    JYMenuviewUITests/

    nothing added to commit but untracked files present

    则执行git add jymenuview.xcodeproj/,把提示的文件都加入到仓库的管理目录下

     

    (2)如果执行git remote add origin

    https://github.com/Flowerowl/stumansys.git

    ,出现错误:

      fatal: remote origin already exists

    则执行以下语句:

      git remote rm origin

    再往后执行git remote add origin https://github.com/Flowerowl/stumansys.git 即可。

    (3)在执行git push origin master时,报错:

      error:failed to push som refs to.......

    则执行以下语句:

      git pull origin master

    先把远程服务器github上面的文件拉下来,再push 上去。

  • 相关阅读:
    115今天太给力了~
    使用jQuery顺序显示元素
    温习浏览器渲染模式
    去除浏览器a标签链接时,烦人的虚线框
    设计可以是一种垄断
    如何获取鼠标选中的文字
    积极参与到FuckIE6的队伍中...
    google今儿发现页面又变好看了
    20101207google 今天出新功能了
    火狐ff下margintop太给力
  • 原文地址:https://www.cnblogs.com/mtjbz/p/5545550.html
Copyright © 2011-2022 走看看