美文网首页
把自己项目上传github

把自己项目上传github

作者: 萝卜酱紫 | 来源:发表于2019-01-09 18:16 被阅读3次
    1.cd 你项目的路径
    2.git init
    3.git add .
    4.git commit -m "注释语句"
    5.git remote add origin https://自己在github创建的仓库url地址
    6.git push -u origin master
    

    把项目上传到github上可能遇到的问题

    1.fatal: remote origin already exists.

    解决办法如下:
    git remote rm origin 
    继续第五步,第六步
    
    1. push代码遇到错误
    $ git push origin master
    To git@github.com:qzmly100/repository-.git
    ! [rejected] master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:qzmly100/repository-.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    

    解决办法

    git push -f origin master  强行让本地分支覆盖远程分支
    

    3.git error “unable to write sha1 filename … Permission denied”

    HTTPS改成SSH
    

    4.利用Xcode把代码提交到github失败“A commit message is required to perform this operation.Enter a commit message and try again.

    需要你写一下你确认提交的信息,就是你这次提交上去修改了什么功能,简单描述一下.
    

    相关文章

      网友评论

          本文标题:把自己项目上传github

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