美文网首页
Git 远程仓库推送

Git 远程仓库推送

作者: clshinem | 来源:发表于2017-05-30 23:19 被阅读0次

    现在github上建立同名字文件夹

    本地文件夹中 git init 将该文件夹设置为Git仓库

    然后git add filename git commit -m "description"

    链接远程仓库git@github.com:FirelightXu/spider_meizidemo.git

    推送到远程仓库 git push -u origin master

    这里有个问题(git新手我也搞不懂是些什么,报的错都是英语也不想看)

    To github.com:FirelightXu/spider_meizidemo
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:FirelightXu/spider_meizidemo'
    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.
    

    反正大概的问题就是远程仓库中有文件不能直接推上去

    解决办法1:

    git fetch
    git merge

    先是把远程的fetch下来,再merge(麻烦死了,下次新建的时候不添加readme文件了)

    解决办法2:

    git push -u origin master 强推吧,反正没什么重要东西

    下次添加了新的文件,直接git push originmaster

    大概是这样???💔

    PS:github 怎么删仓库,打开仓库有个setting 进去delete就可以啦🙋

    相关文章

      网友评论

          本文标题:Git 远程仓库推送

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