git pull简介
来源:互联网 发布:淘宝可以找人代付吗 编辑:程序博客网 时间:2024/05/29 13:04
git pull简介
目录(?)[+]
当git clone之后,直接git pull它会自动匹配一个正确的remote url
是因为在config文件中配置了以下内容:
1 [branch "master"]
2 remote = origin
3 merge = refs/heads/master
表明:
1.git处于master这个branch下时,默认的remote就是origin;
2.当在master这个brach下使用指定remote和merge的git pull时,使用默认的remote和merge。
但是对于自己建的项目,并用push到远程服务器上,并没有这块内容,需要自己配置。
如果直接运行git pull,会得到如此结果:
1 $ git pull
2 Password:
3 You asked me to pull without telling me which branch you
4 want to merge with, and 'branch.master.merge' in
5 your configuration file does not tell me, either. Please
6 specify which branch you want to use on the command line and
7 try again (e.g. 'git pull <repository> <refspec>').
8 See git-pull(1) for details.
9
10 If you often merge with the same branch, you may want to
11 use something like the following in your configuration file:
12
13 [branch "master"]
14 remote = <nickname>
15 merge = <remote-ref>
16
17 [remote "<nickname>"]
18 url = <url>
19 fetch = <refspec>
20
21 See git-config(1) for details.
在参考[2]中,有这样一段:
Note: at this point your repository is not setup to merge _from_ the remote branch when you type 'git pull'. You can either freshly 'clone' the repository (see "Developer checkout" below), or configure your current repository this way:
1 git remote add -f origin login@git.sv.gnu.org:/srv/git/project.git
2 git config branch.master.remote origin
3 git config branch.master.merge refs/heads/master
因此通过git config进行如下配置:
1 $ git config branch.master.remote origin
2 $ git config branch.master.merge refs/heads/master
或者加上--global选项,对于全部项目都使用该配置。
高级内容请参考《git追踪分支》
- git pull简介
- git pull简介
- git pull简介
- git pull
- git pull
- git pull
- git pull
- git pull
- git pull
- git pull
- git pull
- git pull
- git pull
- git push & git pull
- git pull git push
- Git fetch、git pull
- Git git pull error
- git pull 和 git pull --rebase
- Android的按钮Button单击事件及监听器的实现方式
- 编译HAL层生成lib.so文件
- git远程分支的使用
- linux实习笔记(二)
- Microsoft Visual Studio 2012旗舰版(VS2012中文版下载)官方中文版
- git pull简介
- 子线程上的handler处理
- 语句:<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>是什么意思
- android,保存文件到sd卡和读取
- Linux用shell修改文件内容
- c语言读取汉字字模
- Android 4.3 Monkey自动化测试工具被killed的原因分析
- 2014技术目标
- 借助treeView和tableView演示MVC的使用