git pull push没有指定branch报错的解决方法
2017-06-21 10:11
801 查看
git push --set-upstream origin master
git 执行git push 和git pull的操作时候,经常看到下面的提示:<br> <br> You asked me to pull without telling me which branch you<br> want to merge with, and 'branch.dev.merge' in<br> your configuration file does not tell me, either. Please<br> specify which branch you want to use on the command line and<br> try again (e.g. 'git pull <repository> <refspec>').<br> See git-pull(1) for details.<br> <br> If you often merge with the same branch, you may want to<br> use something like the following in your configuration file:<br> <br> [branch "dev"]<br> remote = <nickname><br> merge = <remote-ref><br> <br> [remote "<nickname>"]<br> url = <url><br> fetch = <refspec><br> <br> See git-config(1) for details.<br> <br> <br> <br> 在高版本的 git下面,也许会看见这样的提示:<br> <br> There is no tracking information for the current branch.<br> <br> Please specify which branch you want to merge with.<br> <br> See git-pull(1) for details<br> <br> git pull <remote> <branch><br> <br> If you wish to set tracking information for this branch you can do so with<br> <br> git branch --set-upstream master origin/<branch><br> <br> 看到第二个提示,我们现在知道了一种解决方案。也就是指定当前工作目录工作分支,跟远程的仓库,分支之间的链接关系。<br> <br> 比如我们设置master对应远程仓库的master分支<br> <br> git branch --set-upstream master origin/master<br> <br> 这样在我们每次想push或者pull的时候,只需要 输入git push 或者git pull即可。<br> <br> 在此之前,我们必须要指定想要push或者pull的远程分支。<br> <br> git push origin master<br> <br> git pull origin master.<br>
相关文章推荐
- git pull push没有指定branch报错的解决方法
- git pull push没有指定branch报错的解决方法
- git pull push未指定远程branch报错
- Git rebase、pull、push 出现 conflict 后不能merge的解决方法
- Git push 出错以及server端没有显示push后的文件的解决方法
- Git push 出错以及server端没有显示push后的文件的解决方法
- 用git cmd pull 或push 时提示密码错误的解决方法
- Git push 出错以及server端没有显示push后的文件的解决方法
- git pull没有指定branch报错
- git push 403的解决方法
- git push 一个分支到服务器上错误的解决方法
- Eclipse添加新的git项目之后无法pull的解决方法
- git 提交(push)403错误解决方法
- git pull / git push 记住密码方法(ssh记住密码)
- Git pull、 push 操作无需输密码的方法
- System.Data.OleDb.OleDbException: 至少一个参数没有被指定值 解决方法
- git下push失败解决方法
- asp中提示至少一个参数没有被指定值 解决方法
- 关于"'System.ServiceProcess.ServiceBase' 没有被指定"的错误的解决方法
- Git: push 出错的解决 master -> master (branch is currently checked out)