• git常见问题之git pull时Please specify which branch you want to merge with.


    $ git pull时遇到如下提示

    $ git pull
    warning: no common commits
    remote: Counting objects: 5, done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (5/5), done.
    From github.com:nonfuxinyang/android-study
    * [new branch] master -> origin/master
    There is no tracking information for the current branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details.
    
    git pull <remote> <branch>
    
    If you wish to set tracking information for this branch you can do so with:
    
    git branch --set-upstream-to=origin/<branch> master

    看到第二个提示,我们现在知道了一种解决方案。也就是指定当前工作目录工作分支,跟远程的仓库,分支之间的链接关系。<br>

    比如我们设置master对应远程仓库的master分支

    git branch --set-upstream master origin/master

    这样在我们每次想push或者pull的时候,只需要 输入git push 或者git pull即可。

    在此之前,我们必须要指定想要push或者pull的远程分支。

    git push origin master

    git pull origin master.

     

  • 相关阅读:
    信息搜集与漏洞扫描
    ASN.1分析Alipay证书
    任务计划
    2020系统综合实践 期末大作业 21组
    2020系统综合实践 第6次实践作业 2组
    第5次实践作业
    第4次实践作业
    第3次实践作业
    第2次实践作业
    第1次实践作业
  • 原文地址:https://www.cnblogs.com/lxwphp/p/11193968.html
Copyright © 2020-2023  润新知