zoukankan      html  css  js  c++  java
  • 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.

     

  • 相关阅读:
    Sed的使用方法简介
    Shell脚本基础
    网络配置与内核模块相关
    RPM管理,计划任务与性能监控
    SSH服务
    LVM与RAID阵列
    网络存储服务器
    FTP服务
    网络安全之iptables防火墙
    MySQL使用笔记(七)排序和限制数据记录查询
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15453240.html
Copyright © 2011-2022 走看看