设置git pull的默认地址
git pull origin master
当git clone之后,直接git pull它会自动匹配一个正确的remote url
是因为在config文件中配置了以下内容:
1 [branch "master"]
2 remote = origin
3 merge = refs/heads/master
2 remote = origin
3 merge = refs/heads/master
在参考[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 [email protected]:/srv/git/project.git
2 git config branch.master.remote origin
3 git config branch.master.merge refs/heads/master
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
2 $ git config branch.master.merge refs/heads/master
或者加上--global选项,对于全部项目都使用该配置。
相关推荐
pigsmall 2020-11-19
graseed 2020-10-28
大数据杂谈 2020-09-26
SXIAOYI 2020-09-16
jinhao 2020-09-07
ChinaWin 2020-08-13
mohanzb 2020-08-01
王国平 2020-06-20
yoohsummer 2020-06-01
kangtingting0 2020-05-20
MichelinMessi 2020-02-19
impress 2020-02-20
nicepainkiller 2020-01-25
hfszy0 2013-05-15
lizhenmxcz 2013-05-12
gxyblue 2013-05-11
chenshuixian 2013-06-01
羽化大刀Chrome 2013-05-31
tichangde 2020-01-17