git中local branch追踪remote branch http://www.cnblogs.com/freefish12/p/5819134.html
来源:互联网 发布:json转换为java对象 编辑:程序博客网 时间:2024/06/05 10:31
Git新建本地分支与远程分支关联问题:git branch --set-upstream
git在本地新建分支, push到remote服务器上之后,再次pull下来的时候,如果不做处理会报以下提示:
You asked me to pull without telling me which branch youwant to merge with, and 'branch.production.merge' inyour configuration file does not tell me, either. Pleasespecify which branch you want to use on the command line andtry again (e.g. 'git pull <repository> <refspec>').See git-pull(1) for details. If you often merge with the same branch, you may want touse something like the following in your configuration file: [branch "debug"] remote = <nickname> merge = <remote-ref> [remote "<nickname>"] url = <url> fetch = <refspec> See git-config(1) for details.
问题解析:
git本地新建一个分支后,必须要做远程分支关联。如果没有关联, git 会在下面的操作中提示你显示的添加关联。关联目的是如果在本地分支下操作: git pull, git push ,不需要指定在命令行指定远程的分支. 推送到远程分支后, 你只要没有显示指定, git pull 的时候,就会提示你。
解决方法:
使用命令git branch --set-upstream ;实例如下,其中debug为创建的分支
git branch --set-upstream debug origin/debug
命令的最终修改都是针对 config 文件。
使用-- set-upstream 去跟踪远程分支。
[core] repositoryformatversion = 0 filemode = true bare = true logallrefupdates = true[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@192.168.1.160:android2.3.5_r1.git[branch "master"] remote = origin merge = refs/heads/master[branch "debug"] remote = origin merge = refs/heads/debug[receive]denyCurrentBranch = ignore
注意仓库.git目录下的config文件
阅读全文
0 0
- git中local branch追踪remote branch http://www.cnblogs.com/freefish12/p/5819134.html
- [Git]将remote branch强制更新到local branch
- Git: Delete a branch (local or remote)
- Checkout remote Git branch
- git branch&&rebase&&remote
- http://www.cnblogs.com/flylovesky/p/3274869.html
- http://www.cnblogs.com/ada-zheng/p/3284660.html
- http://www.cnblogs.com/zhanghaiba/p/3548602.html
- http://www.cnblogs.com/scy251147/p/3566638.html
- http://www.cnblogs.com/amosli/p/3577645.html
- http://www.cnblogs.com/VisualImage/p/3594973.html
- http://www.cnblogs.com/kuangbin/p/3164106.html
- http://www.cnblogs.com/wengzilin/p/3530712.html
- http://www.cnblogs.com/qingjoin/p/3549325.html
- http://www.cnblogs.com/interdrp/p/3785164.html
- http://www.cnblogs.com/ruiati/p/3930732.html
- http://www.cnblogs.com/knowledgesea/p/3491214.html
- http://www.cnblogs.com/ganganloveu/p/3755191.html
- 递归二叉树的序列打印、非递归二叉树的序列打印
- UVA
- 反爬虫四个基本策略
- P1182 数列分段Section II
- Swift_学习笔记_自动引用计数
- git中local branch追踪remote branch http://www.cnblogs.com/freefish12/p/5819134.html
- Intellij idea配置scala开发环境
- 普元EOS Platform逻辑流拦截器中如何传参?
- 玲珑学院OJ 1129 喵哈哈村的战斗魔法师丶坏坏い月【暴力分块】
- 多益网络校招笔试题
- 非递归实现两个有序链表
- 命令行压缩工具7z.exe使用详解
- 操作系统的结构
- 企业应该如何维护节假日网站安全